#1518
sudoku
Scrieţi un program care, pentru o matrice 9 x 9
dată, reprezentând un puzzle SUDOKU, determină o soluţie a unui astfel de puzzle.
Problema | sudoku | Operații I/O |
![]() sudoku.in /sudoku.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #41706548 | Utilizator | |
Fișier | sudoku.cpp | Dimensiune | 1.11 KB |
Data încărcării | 01 Februarie 2023, 17:44 | Scor / rezultat | Eroare de compilare |
sudoku.cpp:5:18: error: expected unqualified-id before 'int' struct poz{int l,int c; ^ sudoku.cpp:7:21: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first int nr=0; int a[10][]; bool ok; ^ sudoku.cpp: In function 'int verif(int)': sudoku.cpp:13:10: error: 'a' was not declared in this scope if(a[st[k].l][st[k].c]==a[st[k].l][j] && j!=st[k].c) ^ sudoku.cpp:13:27: error: 'struct poz' has no member named 'c' if(a[st[k].l][st[k].c]==a[st[k].l][j] && j!=st[k].c) ^ sudoku.cpp:13:57: error: 'struct poz' has no member named 'c' if(a[st[k].l][st[k].c]==a[st[k].l][j] && j!=st[k].c) ^ sudoku.cpp:15:27: error: 'struct poz' has no member named 'c' if(a[st[k].l][st[k].c]==a[i][st[k].c] && i!st[k].l) ^ sudoku.cpp:15:42: error: 'struct poz' has no member named 'c' if(a[st[k].l][st[k].c]==a[i][st[k].c] && i!st[k].l) ^ sudoku.cpp:15:49: error: expected ')' before '!' token if(a[st[k].l][st[k].c]==a[i][st[k].c] && i!st[k].l) ^ sudoku.cpp:16:37: error: 'struct poz' has no member named 'c' int x=((st[k].l-1)/3*3+1),y=((st[k].c-1)/3*3+1); ^ sudoku.cpp:16:5: warning: unused variable 'x' [-Wunused-variable] int x=((st[k].l-1)/3*3+1),y=((st[k].c-1)/3*3+1); ^ sudoku.cpp:16:27: warning: unused variable 'y' [-Wunused-variable] int x=((st[k].l-1)/3*3+1),y=((st[k].c-1)/3*3+1); ^ sudoku.cpp:17:8: error: 'x' was not declared in this scope for( i=x;i<=x+2;i++) ^ sudoku.cpp:18:11: error: 'y' was not declared in this scope for(j=y;j<=y+2;++y) ^ sudoku.cpp:19:10: error: 'a' was not declared in this scope if(a[st[k].l][st[k].c]==a[i][j] && st[k].l!=i && st[k].c!=j) ^ sudoku.cpp:19:27: error: 'struct poz' has no member named 'c' if(a[st[k].l][st[k].c]==a[i][j] && st[k].l!=i && st[k].c!=j) ^ sudoku.cpp:19:62: error: 'struct poz' has no member named 'c' if(a[st[k].l][st[k].c]==a[i][j] && st[k].l!=i && st[k].c!=j) ^ sudoku.cpp: In function 'void tipar()': sudoku.cpp:28:12: error: 'a' was not declared in this scope cout<<a[i][j]<<" "; ^ sudoku.cpp: In function 'void bkt(int)': sudoku.cpp:35:3: error: 'a' was not declared in this scope {a[st[k].l][st[k].c]=i; ^ sudoku.cpp:35:20: error: 'struct poz' has no member named 'c' {a[st[k].l][st[k].c]=i; ^ sudoku.cpp:36:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(verif(k)) ^ sudoku.cpp:48:1: error: a function-definition is not allowed here before '{' token {int i,j; ^ sudoku.cpp:59:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sudoku 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ă.