#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 | #64625643 | Utilizator | |
| Fișier | poza.cpp | Dimensiune | 939 B |
| Data încărcării | 19 Mai 2026, 10:42 | Scor/rezultat | 20 puncte |
poza.cpp: In function ‘int main()’: poza.cpp:12:32: warning: variable ‘col’ set but not used [-Wunused-but-set-variable] 12 | int i, j, x, y, w, z, lin, col; | ^~~ poza.cpp:35:35: warning: ‘z’ may be used uninitialized [-Wmaybe-uninitialized] 35 | cout << x - w + 1 << " " << y - z + 1 << "\n"; | ~~^~~ poza.cpp:12:24: note: ‘z’ was declared here 12 | int i, j, x, y, w, z, lin, col; | ^ poza.cpp:33:9: warning: ‘x’ may be used uninitialized [-Wmaybe-uninitialized] 33 | lin = x - w; | ~~~~^~~~~~~ poza.cpp:12:15: note: ‘x’ was declared here 12 | int i, j, x, y, w, z, lin, col; | ^ poza.cpp:35:35: warning: ‘y’ may be used uninitialized [-Wmaybe-uninitialized] 35 | cout << x - w + 1 << " " << y - z + 1 << "\n"; | ~~^~~ poza.cpp:12:18: note: ‘y’ was declared here 12 | int i, j, x, y, w, z, lin, col; | ^ poza.cpp:33:9: warning: ‘w’ may be used uninitialized [-Wmaybe-uninitialized] 33 | lin = x - w; | ~~~~^~~~~~~ poza.cpp:12:21: note: ‘w’ was declared here 12 | int i, j, x, y, w, z, lin, col; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.002 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 20 | |||||
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ă.