#764
Gigel are o livadă împărțită în n*m sectoare, dispuse pe n linii, numeroate de la 1 la n și m coloane, numerotate de la 1 la m. În fiecare sector se află un cireș, care conține o cantitate de cireșe cunoscută. Gigel va culege toate cireșele din cireșii dispuși într-o zonă dreptunghiulară din livadă. El poate să aleagă între k zone și dorește să culeagă cât mai multe cireșe.
Scrieți un program care determină cantitatea maximă de cireșe pe care o poate culege Gigel din una dintre cele k zone date.
| Problema | Cirese | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63892959 | Utilizator | |
| Fișier | cirese.cpp | Dimensiune | 428 B |
| Data încărcării | 25 Martie 2026, 08:28 | Scor/rezultat | Eroare de compilare |
cirese.cpp: In function 'int main()': cirese.cpp:8:7: error: 'n' was not declared in this scope cin>>n>>m>>k; ^ cirese.cpp:8:10: error: 'm' was not declared in this scope cin>>n>>m>>k; ^ cirese.cpp:8:13: error: 'k' was not declared in this scope cin>>n>>m>>k; ^ cirese.cpp:9:6: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ cirese.cpp:10:7: error: 'j' was not declared in this scope for(j=1; j<=m; j++) ^ cirese.cpp:11:9: error: 'a' was not declared in this scope cin>>a[i][j]; ^ cirese.cpp:12:6: error: 'x' was not declared in this scope for(x=1; x<=k; x++) { ^ cirese.cpp:13:8: error: 'x1' was not declared in this scope cin>>x1>>y1>>x2>>y2; ^ cirese.cpp:13:12: error: 'y1' was not declared in this scope cin>>x1>>y1>>x2>>y2; ^ cirese.cpp:13:16: error: 'x2' was not declared in this scope cin>>x1>>y1>>x2>>y2; ^ cirese.cpp:13:20: error: 'y2' was not declared in this scope cin>>x1>>y1>>x2>>y2; ^ cirese.cpp:14:3: error: 's' was not declared in this scope s=0; ^ cirese.cpp:15:7: error: 'i' was not declared in this scope for(i=x1; i<=x2; i++) ^ cirese.cpp:16:8: error: 'j' was not declared in this scope for(j=y1; j<=y2; j++) ^ cirese.cpp:17:9: error: 'a' was not declared in this scope s=s+a[i][j]; ^ cirese.cpp:18:8: error: 'sm' was not declared in this scope if(s>sm) { ^ cirese.cpp:20:4: error: 'nr' was not declared in this scope nr=x; ^ cirese.cpp:21:4: error: 'x0' was not declared in this scope x0=x1; ^ cirese.cpp:22:4: error: 'y0' was not declared in this scope y0=y1; ^ cirese.cpp:23:4: error: 'xf' was not declared in this scope xf=x2; ^ cirese.cpp:24:4: error: 'yf' was not declared in this scope yf=y2; ^ cirese.cpp:27:8: error: 'sm' was not declared in this scope cout<<sm;//<<" "<<nr<<" "<<x0<<" "<<y0<<" "<<xf<<" "<<yf; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cirese 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ă.