#617
Considerăm o tablă de șah pătratică formată din 2n linii și 2n coloane, unde n este un număr natural nenul, formată din 2n*2n zone. Aceasta poate fi acoperită, cu excepția unei singure zone, cu piese în formă de L, fiecare piesă acoperind 3 zone. De exemplu, pentru n=2, o acoperire este următoarea, în care zona neagră este cea neacoperită de piese:

Pentru n dat, determinați o modalitate de acoperire a tablei cu piese, astfel încât să nu se suprapună piesele și să rămână o singură zonă neacoperită.
| Problema | Piese | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 16 MB
|
| Id soluție | #60292423 | Utilizator | |
| Fișier | piese.cpp | Dimensiune | 5.39 KB |
| Data încărcării | 24 Octombrie 2025, 10:48 | Scor/rezultat | Eroare de compilare |
piese.cpp:9:2: error: stray '#' in program }#include <bits/stdc++.h> ^ piese.cpp:84:16: error: stray '#' in program } return 0;#include <bits/stdc++.h> ^ piese.cpp:9:3: error: 'include' does not name a type }#include <bits/stdc++.h> ^ piese.cpp: In function 'int main()': piese.cpp:12:5: error: redefinition of 'int main()' int main() ^ piese.cpp:5:5: error: 'int main()' previously defined here int main() ^ piese.cpp:51:58: error: expected ';' before 'temp' mat[i][j]=mat[i][j+1]=mat[i+1][j]temp; ^ piese.cpp:84:17: error: 'include' was not declared in this scope } return 0;#include <bits/stdc++.h> ^ piese.cpp:84:26: error: 'bits' was not declared in this scope } return 0;#include <bits/stdc++.h> ^ piese.cpp:84:31: error: 'stdc' was not declared in this scope } return 0;#include <bits/stdc++.h> ^ piese.cpp:85:1: error: expected primary-expression before 'using' using namespace std; ^ piese.cpp:85:1: error: expected ';' before 'using' piese.cpp:88:1: error: a function-definition is not allowed here before '{' token { ^ piese.cpp:86:5: warning: unused variable 'n' [-Wunused-variable] int n, m, mat[1025][1025]; ^ piese.cpp:86:8: warning: unused variable 'm' [-Wunused-variable] int n, m, mat[1025][1025]; ^ piese.cpp:86:11: warning: unused variable 'mat' [-Wunused-variable] int n, m, mat[1025][1025]; ^ piese.cpp:159:16: error: expected '}' at end of input } return 0;y ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Piese 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ă.