#396
SCLM
Se dă un șir cu n
elemente, numere naturale. Determinați un cel mai lung subșir crescător al șirului.
Problema | SCLM | Operații I/O |
sclm.in /sclm.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51089749 | Utilizator | |
Fișier | sclm.cpp | Dimensiune | 1.66 KB |
Data încărcării | 23 Mai 2024, 09:50 | Scor / rezultat | Eroare de compilare |
sclm.cpp: In function 'void top_down()': sclm.cpp:40:20: error: 'j' was not declared in this scope poz[i]=j; ^ sclm.cpp: In function 'void maxi()': sclm.cpp:46:20: error: reference to 'max' is ambiguous if(lung[i]>max) ^ sclm.cpp:23:5: note: candidates are: int max int max,cnt,ind; ^ 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 sclm.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) ^ sclm.cpp:47:9: error: reference to 'max' is ambiguous max=l[i],cnt=1,ind=i; ^ sclm.cpp:23:5: note: candidates are: int max int max,cnt,ind; ^ 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 sclm.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) ^ sclm.cpp:47:13: error: 'l' was not declared in this scope max=l[i],cnt=1,ind=i; ^ sclm.cpp:49:12: error: 'l' was not declared in this scope if(l[i]==max) cnt++; ^ sclm.cpp:49:18: error: reference to 'max' is ambiguous if(l[i]==max) cnt++; ^ sclm.cpp:23:5: note: candidates are: int max int max,cnt,ind; ^ 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 sclm.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 SCLM 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ă.