#2781
Se consideră o pădure ce conține n•m copaci aranjați pe n linii și m coloane în care s-a produs un incendiu. Pădurarii cunosc coordonatele x și y ale copacului de la care a izbucnit focul și modalitatea prin care acesta se extinde. Astfel, dacă un copac se aprinde într-o anumită zi, în ziua următoare se vor aprind copacii vecini cu acesta pe linie sau coloană care nu sunt încă afectați de incendiu.
Știind x și y, coordonatele inițiale ale focului și n și m, dimensiunile pădurii, ajutați pădurarii să determine numărul minim de zile după care întreaga pădure va fi afectată.
| Problema | Wildfire | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64684173 | Utilizator | |
| Fișier | wildfire.cpp | Dimensiune | 323 B |
| Data încărcării | 22 Mai 2026, 16:30 | Scor/rezultat | Eroare de compilare |
wildfire.cpp: In function ‘int main()’: wildfire.cpp:5:5: error: ‘intx’ was not declared in this scope; did you mean ‘int’? 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^~~~ | int wildfire.cpp:5:10: error: ‘y’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ wildfire.cpp:5:12: error: ‘n’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ wildfire.cpp:5:14: error: ‘z’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ wildfire.cpp:5:16: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ | tm wildfire.cpp:5:18: error: ‘c’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ wildfire.cpp:5:20: error: ‘k’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ wildfire.cpp:5:22: error: ‘z1’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^~ wildfire.cpp:5:25: error: ‘z2’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^~ wildfire.cpp:5:28: error: ‘q’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ wildfire.cpp:5:30: error: ‘s’ was not declared in this scope 5 | intx,y,n,z,m,c,k,z1,z2,q,s; | ^ wildfire.cpp:6:16: error: ‘x’ was not declared in this scope 6 | cin>>n>>m>>x>>y; | ^ wildfire.cpp:12:9: error: expected ‘}’ before ‘else’ 12 | else | ^~~~ wildfire.cpp:10:5: note: to match this ‘{’ 10 | { | ^ wildfire.cpp: At global scope: wildfire.cpp:15:5: error: ‘s’ does not name a type 15 | s=m-y; | ^ wildfire.cpp:16:5: error: ‘q’ does not name a type 16 | q=m-(m-y); | ^ wildfire.cpp:17:5: error: expected unqualified-id before ‘if’ 17 | if(s>q) | ^~ wildfire.cpp:23:5: error: ‘z’ does not name a type 23 | z=z1+z2; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Wildfire 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ă.