#597
Poza
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 |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58019037 | Utilizator | |
Fișier | poza.cpp | Dimensiune | 942 B |
Data încărcării | 08 Mai 2025, 16:29 | Scor / rezultat | Eroare de compilare |
poza.cpp: In function 'int main()': poza.cpp:5:35: error: 'startj' was not declared in this scope int n,k,starti = -1 , endi = -1;startj = 0,endj = 0; ^ poza.cpp:5:46: error: 'endj' was not declared in this scope int n,k,starti = -1 , endi = -1;startj = 0,endj = 0; ^ poza.cpp:10:15: error: 'm' was not declared in this scope cin >>m[i][j]; ^ poza.cpp:12:16: error: 'startI' was not declared in this scope if(startI==-1)startI=i; ^ poza.cpp:13:17: error: 'endI' was not declared in this scope endI=i; ^ poza.cpp:14:17: error: 'startJ' was not declared in this scope startJ=min(startJ,j); ^ poza.cpp:15:17: error: 'endJ' was not declared in this scope endJ=max(endJ,j);} ^ poza.cpp:26:13: error: 'endI' was not declared in this scope cout <<endI-startI+1<<" " <<endJ-startJ+1<<endl; ^ poza.cpp:26:18: error: 'startI' was not declared in this scope cout <<endI-startI+1<<" " <<endJ-startJ+1<<endl; ^ poza.cpp:26:34: error: 'endJ' was not declared in this scope cout <<endI-startI+1<<" " <<endJ-startJ+1<<endl; ^ poza.cpp:26:39: error: 'startJ' was not declared in this scope cout <<endI-startI+1<<" " <<endJ-startJ+1<<endl; ^ poza.cpp:29:15: error: 'm' was not declared in this scope cout<<m[i][j]<<" "; ^ poza.cpp:34:5: error: expected ';' before '}' token } ^ poza.cpp:5:11: warning: unused variable 'starti' [-Wunused-variable] int n,k,starti = -1 , endi = -1;startj = 0,endj = 0; ^ poza.cpp:5:25: warning: unused variable 'endi' [-Wunused-variable] int n,k,starti = -1 , endi = -1;startj = 0,endj = 0; ^ poza.cpp: At global scope: poza.cpp:57:2: error: expected unqualified-id before 'return' return 0 ; ^ poza.cpp:58:1: error: expected declaration before '}' token } ^
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ă.