#4809
nota10
C++
Se dă un număr n
și apoi un șir cu n
elemente, numere naturale nenule. Să se determine câte dintre numerele din șir sunt strict
mai mari decât precedentele lor.
adhoc
Problema | nota10 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
Id soluție | #58090335 | Utilizator | |
Fișier | nota10.cpp | Dimensiune | 301 B |
Data încărcării | 13 Mai 2025, 16:54 | Scor / rezultat | Eroare de compilare |
nota10.cpp: In function 'int main()': nota10.cpp:9:5: error: reference to 'max' is ambiguous max=x; ^ nota10.cpp:4:25: note: candidates are: int max int n,i,aux=0,cnt=0,x,y,max; ^ 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 nota10.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) ^ nota10.cpp:13:14: error: reference to 'max' is ambiguous if(y>max) ^ nota10.cpp:4:25: note: candidates are: int max int n,i,aux=0,cnt=0,x,y,max; ^ 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 nota10.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) ^ nota10.cpp:16:10: error: reference to 'max' is ambiguous max=y; ^ nota10.cpp:4:25: note: candidates are: int max int n,i,aux=0,cnt=0,x,y,max; ^ 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 nota10.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 nota10 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ă.