#1459
dim_maxim_binar
Scrieţi un program care, citind de la tastatură cuvântul C
, construieşte în memorie matricea reprezentării binare a cuvântului şi afişează pe ecran dimensiunea celei mai mari submatrici pătratice conţinând elemente având toate aceeaşi valoare (fie 0
, fie 1
).
Problema | dim_maxim_binar | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53229423 | Utilizator | |
Fișier | dim_maxim_binar.cpp | Dimensiune | 1.10 KB |
Data încărcării | 21 Octombrie 2024, 22:36 | Scor / rezultat | Eroare de compilare |
dim_maxim_binar.cpp: In function 'int main()': dim_maxim_binar.cpp:7:31: error: expression list treated as compound expression in initializer [-fpermissive] bool areamax(i , j , x , y) ^ dim_maxim_binar.cpp:7:31: warning: left operand of comma operator has no effect [-Wunused-value] dim_maxim_binar.cpp:7:31: warning: right operand of comma operator has no effect [-Wunused-value] dim_maxim_binar.cpp:7:31: warning: right operand of comma operator has no effect [-Wunused-value] dim_maxim_binar.cpp:8:3: error: expected ',' or ';' before '{' token { ^ dim_maxim_binar.cpp:31:6: error: reference to 'max' is ambiguous max=0; ^ dim_maxim_binar.cpp:4:26: note: candidates are: int max int a[101][9],i,j,x,y,nr,max,k,q,t; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from dim_maxim_binar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ dim_maxim_binar.cpp:32:10: warning: left operand of comma operator has no effect [-Wunused-value] x , y , z , t; ^ dim_maxim_binar.cpp:32:14: error: 'z' was not declared in this scope x , y , z , t; ^ dim_maxim_binar.cpp:44:49: error: 'areamax' cannot be used as a function if(areamax(j , k , j + q , k + q)) ^ dim_maxim_binar.cpp:45:28: error: reference to 'max' is ambiguous if(q > max) ^ dim_maxim_binar.cpp:4:26: note: candidates are: int max int a[101][9],i,j,x,y,nr,max,k,q,t; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from dim_maxim_binar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ dim_maxim_binar.cpp:46:25: error: reference to 'max' is ambiguous max=q , x = j , y = k , z = j+q , t=k+q; ^ dim_maxim_binar.cpp:4:26: note: candidates are: int max int a[101][9],i,j,x,y,nr,max,k,q,t; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from dim_maxim_binar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ dim_maxim_binar.cpp:49:13: error: reference to 'max' is ambiguous cout << max+1; ^ dim_maxim_binar.cpp:4:26: note: candidates are: int max int a[101][9],i,j,x,y,nr,max,k,q,t; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from dim_maxim_binar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema dim_maxim_binar 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ă.