#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 | #50417558 | Utilizator | |
Fișier | dreptunghi1.cpp | Dimensiune | 1.06 KB |
Data încărcării | 08 Aprilie 2024, 21:42 | Scor / rezultat | Eroare de compilare |
dreptunghi1.cpp: In function 'int main()': dreptunghi1.cpp:37:76: error: no matching function for call to 'max(short int&, int)' for(int j = 1; j<=m; j++)raspuns=max(raspuns,h[j]*(r[j] - l[j] - 1)); ^ dreptunghi1.cpp:37:76: 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:37:76: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') for(int j = 1; j<=m; j++)raspuns=max(raspuns,h[j]*(r[j] - l[j] - 1)); ^ 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:37:76: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') for(int j = 1; j<=m; j++)raspuns=max(raspuns,h[j]*(r[j] - l[j] - 1)); ^
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ă.