#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 | #64309772 | Utilizator | |
| Fișier | poza.cpp | Dimensiune | 657 B |
| Data încărcării | 29 Aprilie 2026, 08:41 | Scor/rezultat | Eroare de compilare |
poza.cpp:3:9: error: expected unqualified-id before ‘if’ 3 | int li, if, ci, cf, p, q,i, m, n, a[i][j]; | ^~ poza.cpp: In function ‘int main()’: poza.cpp:5:10: error: ‘n’ was not declared in this scope 5 | cin>>n>>m; | ^ poza.cpp:5:13: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 5 | cin>>n>>m; | ^ | tm poza.cpp:6:9: error: ‘i’ was not declared in this scope; did you mean ‘li’? 6 | for(i=1;i<=n;i++) | ^ | li poza.cpp:7:13: error: ‘j’ was not declared in this scope 7 | for(j=1;j<=n;j++); | ^ poza.cpp:6:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(i=1;i<=n;i++) | ^~~ poza.cpp:8:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 8 | for(a[i][j]==1) | ^~~ poza.cpp:8:13: error: ‘a’ was not declared in this scope 8 | for(a[i][j]==1) | ^ poza.cpp:8:15: error: ‘i’ was not declared in this scope; did you mean ‘li’? 8 | for(a[i][j]==1) | ^ | li poza.cpp:8:18: error: ‘j’ was not declared in this scope 8 | for(a[i][j]==1) | ^ poza.cpp:23:30: error: expected primary-expression at end of input 23 | cout<<a[i][j]<<" ";) | ^ poza.cpp:23:30: error: expected ‘;’ at end of input 23 | cout<<a[i][j]<<" ";) | ^ | ; poza.cpp:23:30: error: expected primary-expression at end of input poza.cpp:23:30: error: expected ‘)’ at end of input 23 | cout<<a[i][j]<<" ";) | ^ | ) poza.cpp:8:12: note: to match this ‘(’ 8 | for(a[i][j]==1) | ^ poza.cpp:23:30: error: expected statement at end of input 23 | cout<<a[i][j]<<" ";) | ^ poza.cpp:23:30: error: expected ‘}’ at end of input poza.cpp:4:11: note: to match this ‘{’ 4 | int main(){ | ^
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ă.