#739
Cuburi1
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 | #52407233 | Utilizator | |
Fișier | cuburi1.cpp | Dimensiune | 1.54 KB |
Data încărcării | 29 Septembrie 2024, 14:52 | Scor / rezultat | Eroare de compilare |
cuburi1.cpp:2:10: warning: character constant too long for its type [enabled by default] const fi='cuburi1.in'; ^ cuburi1.cpp:3:10: warning: character constant too long for its type [enabled by default] fo='cuburi1.out'; ^ cuburi1.cpp:8:16: error: too many decimal points in number cub=array[1..3]of fete_opuse; ^ cuburi1.cpp:37:12: warning: multi-character character constant [-Wmultichar] c[1]:='xx';c[2]:='xx';c[3]:='xx'; ^ cuburi1.cpp:37:23: warning: multi-character character constant [-Wmultichar] c[1]:='xx';c[2]:='xx';c[3]:='xx'; ^ cuburi1.cpp:37:34: warning: multi-character character constant [-Wmultichar] c[1]:='xx';c[2]:='xx';c[3]:='xx'; ^ cuburi1.cpp:1:1: error: 'program' does not name a type program cuburi_colorate; ^ cuburi1.cpp:2:7: error: 'fi' does not name a type const fi='cuburi1.in'; ^ cuburi1.cpp:3:7: error: 'fo' does not name a type fo='cuburi1.out'; ^ cuburi1.cpp:4:7: error: 'max' does not name a type max=13;lmax=chr(64+max); ^ cuburi1.cpp:4:14: error: 'lmax' does not name a type max=13;lmax=chr(64+max); ^ cuburi1.cpp:5:1: error: 'type' does not name a type type culoare='A'..lmax; ^ cuburi1.cpp:6:6: error: 'fete_opuse' does not name a type fete_opuse=string[2]; ^ cuburi1.cpp:7:6: error: 'model' does not name a type model=string[4]; ^ cuburi1.cpp:8:6: error: 'cub' does not name a type cub=array[1..3]of fete_opuse; ^ cuburi1.cpp:9:1: error: 'var' does not name a type var s:array [culoare,culoare,culoare,culoare] of word; ^ cuburi1.cpp:10:6: error: found ':' in nested-name-specifier, expected '::' f:text; ^ cuburi1.cpp:10:5: error: 'f' does not name a type f:text; ^ cuburi1.cpp:11:5: error: 'n' does not name a type n,nsol,i,j:word; ^ cuburi1.cpp:12:6: error: found ':' in nested-name-specifier, expected '::' c:cub;sol:model; ^ cuburi1.cpp:12:5: error: 'c' does not name a type c:cub;sol:model; ^ cuburi1.cpp:12:14: error: found ':' in nested-name-specifier, expected '::' c:cub;sol:model; ^ cuburi1.cpp:12:11: error: 'sol' does not name a type c:cub;sol:model; ^ cuburi1.cpp:13:5: error: 'l1' does not name a type l1,l2,l3,l4:char; ^ cuburi1.cpp:14:1: error: 'procedure' does not name a type procedure sort(var f:fete_opuse); ^ cuburi1.cpp:15:1: error: 'var' does not name a type var x:culoare; ^ cuburi1.cpp:16:1: error: 'begin' does not name a type begin ^ cuburi1.cpp:17:35: error: 'f' does not name a type if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; ^ cuburi1.cpp:17:46: error: 'f' does not name a type if f[1]>f[2] then begin x:=f[1];f[1]:=f[2];f[2]:=x end; ^ cuburi1.cpp:18:1: error: 'end' does not name a type end; ^ cuburi1.cpp:19:1: error: 'procedure' does not name a type procedure sortm(var c:cub); ^ cuburi1.cpp:20:1: error: 'var' does not name a type var x:fete_opuse; ^ cuburi1.cpp:21:1: error: 'begin' does not name a type begin ^ cuburi1.cpp:22:36: error: 'c' does not name a type if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; ^ cuburi1.cpp:22:47: error: 'c' does not name a type if c[1]>c[2] then begin x:=c[1];c[1]:=c[2];c[2]:=x end; ^ cuburi1.cpp:23:4: error: expected unqualified-id before 'if' if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; ^ cuburi1.cpp:23:36: error: 'c' does not name a type if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; ^ cuburi1.cpp:23:47: error: 'c' does not name a type if c[1]>c[3] then begin x:=c[1];c[1]:=c[3];c[3]:=x end; ^ cuburi1.cpp:24:4: error: expected unqualified-id before 'if' if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; ^ cuburi1.cpp:24:36: error: 'c' does not name a type if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; ^ cuburi1.cpp:24:47: error: 'c' does not name a type if c[2]>c[3] then begin x:=c[2];c[2]:=c[3];c[3]:=x end; ^ cuburi1.cpp:25:1: error: 'end' does not name a type end; ^ cuburi1.cpp:26:1: error: 'procedure' does not name a type procedure modele(c:cub); ^ cuburi1.cpp:27:1: error: 'var' does not name a type var m1,m2,m3:model; ^ cuburi1.cpp:28:1: error: 'begin' does not name a type begin ^ cuburi1.cpp:29:20: error: 'm2' does not name a type m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; ^ cuburi1.cpp:29:34: error: 'm3' does not name a type m1:=c[1]+c[2];m2:=c[1]+c[3];m3:=c[2]+c[3]; ^ cuburi1.cpp:30:9: error: expected constructor, destructor, or type conversion before '(' token inc(s[m1[1],m1[2],m1[3],m1[4]]); ^ cuburi1.cpp:31:6: error: expected unqualified-id before 'if' if m2<>m1 then inc(s[m2[1],m2[2],m2[3],m2[4]]); ^ cuburi1.cpp:32:6: error: expected unqualified-id before 'if' if (m3<>m1)and(m3<>m2) then inc(s[m3[1],m3[2],m3[3],m3[4]]); ^ cuburi1.cpp:33:1: error: 'end' does not name a type end; ^ cuburi1.cpp:34:1: error: 'begin' does not name a type begin ^ cuburi1.cpp:35:24: error: expected constructor, destructor, or type conversion before '(' token assign(f,fi);reset(f); ^ cuburi1.cpp:36:12: error: expected constructor, destructor, or type conversion before '(' token readln(f,n); ^ cuburi1.cpp:37:6: error: 'c' does not name a type c[1]:='xx';c[2]:='xx';c[3]:='xx'; ^ cuburi1.cpp:37:17: error: 'c' does not name a type c[1]:='xx';c[2]:='xx';c[3]:='xx'; ^ cuburi1.cpp:37:28: error: 'c' does not name a type c[1]:='xx';c[2]:='xx';c[3]:='xx'; ^ cuburi1.cpp:38:6: error: expected unqualified-id before 'for' for i:=1 to n do begin ^ cuburi1.cpp:40:10: error: expected unqualified-id before 'for' for j:=1 to 3 do sort(c[j]); ^ cuburi1.cpp:41:15: error: expected constructor, destructor, or type conversion before '(' token sortm(c); ^ cuburi1.cpp:42:16: error: expected constructor, destructor, or type conversion before '(' token modele(c); ^ cuburi1.cpp:43:6: error: 'end' does not name a type end; ^ cuburi1.cpp:44:11: error: expected constructor, destructor, or type conversion before '(' token close(f); ^ cuburi1.cpp:45:12: error: expected constructor, destructor, or type conversion before '(' token assign(f,fo);rewrite(f); ^ cuburi1.cpp:45:26: error: expected constructor, destructor, or type conversion before '(' token assign(f,fo);rewrite(f); ^ cuburi1.cpp:46:6: error: 'nsol' does not name a type nsol:=0;sol[0]:=chr(4); ^ cuburi1.cpp:46:14: error: 'sol' does not name a type nsol:=0;sol[0]:=chr(4); ^ cuburi1.cpp:47:6: error: expected unqualified-id before 'for' for l1:='A' to lmax do ^ cuburi1.cpp:53:13: error: expected constructor, destructor, or type conversion before '(' token writeln(f,nsol); ^ cuburi1.cpp:54:11: error: expected constructor, destructor, or type conversion before '(' token close(f) ^
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ă.