#1581
max_suma
Se dau n
şiruri, fiecare şir fiind format din m
numere. Să se determine cel mai mare număr din fiecare şir. Să se determine suma numerelor fiecărui şir.
Problema | max_suma | Operații I/O |
max_suma.in /max_suma.out
|
---|---|---|---|
Limita timp | 0.02 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54754096 | Utilizator | |
Fișier | max_suma.cpp | Dimensiune | 454 B |
Data încărcării | 07 Decembrie 2024, 14:33 | Scor / rezultat | Eroare de compilare |
max_suma.cpp: In function 'int main()': max_suma.cpp:9:5: error: reference to 'max' is ambiguous max=-1; ^ max_suma.cpp:5:16: note: candidates are: int max int n,m,x,i,j,max,s; ^ 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 max_suma.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) ^ max_suma.cpp:18:20: error: reference to 'max' is ambiguous if(x > max) max = x; ^ max_suma.cpp:5:16: note: candidates are: int max int n,m,x,i,j,max,s; ^ 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 max_suma.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) ^ max_suma.cpp:18:25: error: reference to 'max' is ambiguous if(x > max) max = x; ^ max_suma.cpp:5:16: note: candidates are: int max int n,m,x,i,j,max,s; ^ 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 max_suma.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) ^ max_suma.cpp:20:13: error: reference to 'max' is ambiguous o<< max << " " << s << endl; ^ max_suma.cpp:5:16: note: candidates are: int max int n,m,x,i,j,max,s; ^ 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 max_suma.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 max_suma 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ă.