#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 | #64309666 | Utilizator | |
| Fișier | poza.cpp | Dimensiune | 437 B |
| Data încărcării | 29 Aprilie 2026, 08:40 | Scor/rezultat | Eroare de compilare |
poza.cpp: In function ‘int main()’: poza.cpp:8:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 8 | if(a[i][j]=1) | ~~~~~~~^~ poza.cpp:6:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(i=1;i<=n;i++) | ^~~ poza.cpp:10:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 10 | i=m+1-j; | ^ poza.cpp:14:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 14 | if(a[i][j]==1) | ^~ poza.cpp:15:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 15 | ci=j;j=ml=1; | ^ poza.cpp:17:14: warning: range-based ‘for’ loops with initializer only available with ‘-std=c++20’ or ‘-std=gnu++20’ [-Wc++20-extensions] 17 | for(i=n;i>=1:i--) | ^ poza.cpp:17:18: error: expected ‘;’ before ‘:’ token 17 | for(i=n;i>=1:i--) | ^ | ; poza.cpp:17:15: warning: statement has no effect [-Wunused-value] 17 | for(i=n;i>=1:i--) | ~^~~ poza.cpp:18:20: warning: for increment expression has no effect [-Wunused-value] 18 | for(j=m;j>=m;j>=1;j++) | ~^~~ poza.cpp:18:23: error: expected ‘)’ before ‘;’ token 18 | for(j=m;j>=m;j>=1;j++) | ^ | ) poza.cpp:17:9: note: to match this ‘(’ 17 | for(i=n;i>=1:i--) | ^ poza.cpp:17:6: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 17 | for(i=n;i>=1:i--) | ^~~ poza.cpp:18:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 18 | for(j=m;j>=m;j>=1;j++) | ^ poza.cpp:18:27: error: expected ‘;’ before ‘)’ token 18 | for(j=m;j>=m;j>=1;j++) | ^ | ; poza.cpp:23:12: error: expected primary-expression at end of input 23 | p= | ^ poza.cpp:23:12: error: expected ‘}’ at end of input poza.cpp:16:6: note: to match this ‘{’ 16 | { | ^ poza.cpp:23:12: error: expected ‘}’ at end of input 23 | p= | ^ poza.cpp:11:2: note: to match this ‘{’ 11 | { | ^ poza.cpp:23:12: error: expected ‘}’ at end of input 23 | p= | ^ poza.cpp:5:1: note: to match this ‘{’ 5 | {cin>>n; | ^
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ă.