#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 | #54594572 | Utilizator | |
Fișier | sclm.cpp | Dimensiune | 726 B |
Data încărcării | 03 Decembrie 2024, 11:27 | Scor / rezultat | Eroare de compilare |
sclm.cpp: In function 'int main()': sclm.cpp:16:9: error: reference to 'next' is ambiguous next[i]= -1; ^ sclm.cpp:4:23: note: candidates are: int next [1001] int n,a[1001],l[1001],next[1001]; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 sclm.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type) next(_ForwardIterator __x, typename ^ sclm.cpp:21:17: error: reference to 'next' is ambiguous next[i]=j; ^ sclm.cpp:4:23: note: candidates are: int next [1001] int n,a[1001],l[1001],next[1001]; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 sclm.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type) next(_ForwardIterator __x, typename ^ sclm.cpp:28:13: error: 'L' was not declared in this scope fout << L[imax] << '\n'; ^ sclm.cpp:29:28: error: reference to 'next' is ambiguous for(int i=imax;i!=-1;i=next[i]) ^ sclm.cpp:4:23: note: candidates are: int next [1001] int n,a[1001],l[1001],next[1001]; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:66:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 sclm.cpp:1: /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:184:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type) next(_ForwardIterator __x, typename ^
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ă.