#597
Fie o poză dată sub forma unei matrice cu n linii și m coloane, în care elementele sunt 0 sau 1: un element 0 reprezintă fundalul imaginii, iar un element 1 reprezintă obiect din prim plan. Este necesară tăierea unei bucăți din imagine astfel încât:
Determinați dimensiunile pozei tăiate, precum și conținutul ei.
| Problema | Poza | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64350647 | Utilizator | |
| Fișier | poza.cpp | Dimensiune | 882 B |
| Data încărcării | 01 Mai 2026, 14:04 | Scor/rezultat | 100 puncte |
poza.cpp: In function ‘int main()’: poza.cpp:6:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(j=1;j<=m;j++)cin>>a[i][j]; for(i=1;i<=n;i++) for(j=1;j<=m;j++) if(a[i][j]==1) | ^~~ poza.cpp:6:51: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 6 | for(j=1;j<=m;j++)cin>>a[i][j]; for(i=1;i<=n;i++) for(j=1;j<=m;j++) if(a[i][j]==1) | ^~~ poza.cpp:5:16: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 5 | for(i=1;i<=n;i++) | ^~~ poza.cpp:6:51: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 6 | for(j=1;j<=m;j++)cin>>a[i][j]; for(i=1;i<=n;i++) for(j=1;j<=m;j++) if(a[i][j]==1) | ^~~ poza.cpp:13:34: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for(i=n;i>=1;i--) for(j=m; j>=1; j--) | ^~~ poza.cpp:14:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 14 | if(a[i][j]==1) {lf=i; i=0;j=0;} for(j=m; j>=1;j--) for(i=n; i>=1; i--) | ^~~ poza.cpp:19:18: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 19 | { for(j=ci; j<=cf; j++) | ^~~ poza.cpp:20:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 20 | cout<<a[i][j]<<" "; cout<<endl;} | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.003 secunde | OK. | 40 | 40 | ||
| 3 | 0.002 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Poza 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ă.