#840
Se dă o matrice cu n linii și m coloane și elemente 0 sau 1, care reprezintă harta unui lac, în care 1 înseamnă uscat, iar 0 înseamnă apă.
Să se plaseze pe fiecare zonă cu uscat un crocodil sau un elefant astfel încât să nu fie două animale din aceeași specie în zone învecinate.
| Problema | Croco | Operații I/O |
croco.in/croco.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64245889 | Utilizator | |
| Fișier | croco.cpp | Dimensiune | 1.52 KB |
| Data încărcării | 25 Aprilie 2026, 13:01 | Scor/rezultat | Eroare de compilare |
croco.cpp: In function ‘int main()’: croco.cpp:30:12: warning: statement has no effect [-Wunused-value] 30 | v[i][j]=='A'; | ~~~~~~~^~~~~ croco.cpp: At global scope: croco.cpp:41:5: error: redefinition of ‘int x [4]’ 41 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:3:5: note: ‘int x [4]’ previously defined here 3 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:41:29: error: redefinition of ‘int y [4]’ 41 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:3:29: note: ‘int y [4]’ previously defined here 3 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:41:53: error: redefinition of ‘int i’ 41 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:3:53: note: ‘int i’ previously declared here 3 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:41:57: error: redefinition of ‘int j’ 41 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:3:57: note: ‘int j’ previously declared here 3 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:41:61: error: redefinition of ‘int n’ 41 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:3:61: note: ‘int n’ previously declared here 3 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:41:65: error: redefinition of ‘int m’ 41 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:3:65: note: ‘int m’ previously declared here 3 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:41:69: error: redefinition of ‘int c’ 41 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:3:69: note: ‘int c’ previously declared here 3 | int x[4]={0 , 1 , 0 , -1} , y[4]={1 , 0 , -1 , 0} , i , j , n , m , c; | ^ croco.cpp:42:6: error: redefinition of ‘char v [101][101]’ 42 | char v[101][101]; | ^ croco.cpp:4:6: note: ‘char v [101][101]’ previously declared here 4 | char v[101][101]; | ^ croco.cpp:43:6: error: redefinition of ‘void gokusolos(int, int)’ 43 | void gokusolos(int a , int b){ | ^~~~~~~~~ croco.cpp:5:6: note: ‘void gokusolos(int, int)’ previously defined here 5 | void gokusolos(int a , int b){ | ^~~~~~~~~ croco.cpp:56:5: error: redefinition of ‘int main()’ 56 | int main(){ | ^~~~ croco.cpp:18:5: note: ‘int main()’ previously defined here 18 | int main(){ | ^~~~ croco.cpp: In function ‘int main()’: croco.cpp:68:12: warning: statement has no effect [-Wunused-value] 68 | v[i][j]=='A'; | ~~~~~~~^~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Croco 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ă.