#2665
Dreptunghi1
Dată fiind o matrice dreptunghiulară cu elemente 0
şi 1
, care este aria maximă a unui dreptunghi format numai din elemente egale cu 1
?
Problema | Dreptunghi1 | Operații I/O |
dreptunghi1.in /dreptunghi1.out
|
---|---|---|---|
Limita timp | 2.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 56 MB
|
Id soluție | #53445416 | Utilizator | |
Fișier | dreptunghi1.cpp | Dimensiune | 1.37 KB |
Data încărcării | 30 Octombrie 2024, 21:55 | Scor / rezultat | Eroare de compilare |
dreptunghi1.cpp: In function 'int main()': dreptunghi1.cpp:76:72: error: no matching function for call to 'max(short int&, int)' for(int j = 1; j<=m; ++j) rasp = max(rasp,(dr[j]-st[j]+1)*sp[j]); ^ dreptunghi1.cpp:76:72: note: candidates are: 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/istream:38, from /usr/include/c++/4.8/fstream:38, from dreptunghi1.cpp:1: /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) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: dreptunghi1.cpp:76:72: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') for(int j = 1; j<=m; ++j) rasp = max(rasp,(dr[j]-st[j]+1)*sp[j]); ^ 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/istream:38, from /usr/include/c++/4.8/fstream:38, from dreptunghi1.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:260:5: note: template argument deduction/substitution failed: dreptunghi1.cpp:76:72: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') for(int j = 1; j<=m; ++j) rasp = max(rasp,(dr[j]-st[j]+1)*sp[j]); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from dreptunghi1.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template argument deduction/substitution failed: dreptunghi1.cpp:76:72: note: mismatched types 'std::initializer_list<_Tp>' and 'short int' for(int j = 1; j<=m; ++j) rasp = max(rasp,(dr[j]-st[j]+1)*sp[j]); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from dreptunghi1.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template argument deduction/substitution failed: dreptunghi1.cpp:76:72: note: mismatched types 'std::initializer_list<_Tp>' and 'short int' for(int j = 1; j<=m; ++j) rasp = max(rasp,(dr[j]-st[j]+1)*sp[j]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dreptunghi1 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ă.