#739
Fie n cuburi de aceeaşi mărime, cu feţe colorate. Culorile sunt codificate prin câte o literă de la A la M. Pentru fiecare cub se cunosc culorile feţelor în ordinea: bază, capac, faţă frontală, faţă laterală dreapta, faţa din spate, faţă laterală stânga. Să se determine numărul maxim de cuburi care, răsturnate şi rotite convenabil, pot fi puse unul peste altul astfel încât să formeze un turn cu toate feţele uniform colorate (fiecare faţă a turnului sa fie de aceeaşi culoare, de la primul, până la ultimul cub al turnului).
| Problema | Cuburi1 | Operații I/O |
cuburi1.in/cuburi1.out
|
|---|---|---|---|
| Limita timp | 0.25 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
| Id soluție | #63930865 | Utilizator | |
| Fișier | cuburi1.cpp | Dimensiune | 1.29 KB |
| Data încărcării | 27 Martie 2026, 11:26 | Scor/rezultat | Eroare de compilare |
cuburi1.cpp:1:35: warning: character constant too long for its type [enabled by default] program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:52: warning: character constant too long for its type [enabled by default] program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:165: error: too many decimal points in number program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:930: warning: multi-character character constant [-Wmultichar] program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:941: warning: multi-character character constant [-Wmultichar] program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:952: warning: multi-character character constant [-Wmultichar] program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:1: error: 'program' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:32: error: 'fi' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:49: error: 'fo' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:67: error: 'max' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:74: error: 'lmax' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:92: error: 'type' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:116: error: 'fete_opuse' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:138: error: 'model' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:155: error: 'cub' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:185: error: 'var' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:241: error: found ':' in nested-name-specifier, expected '::' program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:240: error: 'f' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cuburi1.cpp:1:248: error: 'n' does not name a type program cuburi_colorate; const fi='cuburi1.in'; fo='cuburi1.out'; max=13;lmax=chr(64+max); type culoare='A'..lmax; fete_opuse=string[2]; model=string[4]; cub=array[1..3]of fete_opuse; var s:array [culoare,culoare,culoare,culoare] of word; f:text; n,nsol,i,j:word; c:cub;sol:model; l1,l2,l3,l4:char; procedure sort(var f:fete_opuse); var x:culoare; begin if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; end; procedure sortm(var c:cub); var x:fete_opuse; begin if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; end; procedure modele(c:cub); var m1,m2,m3:model; begin m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; inc(s[m1[1],m1[2],m1[3],m1[4]]); if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); end; begin assign(f,fi);reset(f); readln(f,n); c[1]:='xx';c[2]:='xx';c[3]:='xx'; for i:=1 to n do begin readln(f,c[1][1],c[1][2],c[2][1],c[3][1],c[2][2],c[3][2]); for j:=1 to 3 do sort(c[j]); sortm(c); modele(c); end; close(f); assign(f,fo);rewrite(f); nsol:=0;sol[0]:=chr(4); for l1:='A' to lmax do for l2:='A' to lmax do for l3:='A' to lmax do for l4:='A' to lmax do if s[l1,l2,l3,l4]>nsol then nsol:=s[l1,l2,l3,l4]; writeln(f,nsol); close(f) end. ^ cc1plus: out of memory allocating 1677721600 bytes after a total of 475136 bytes
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cuburi1 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.