Borderou de evaluare (job #2243866)

Utilizator cosmin.pascaruPascaru Cosmin cosmin.pascaru Data 21 septembrie 2018 16:10:54
Problema Subsir crescator maximal Status done
Runda Arhiva educationala Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp: In function ‘std::vector<int> computeLongestIncreasingSubsequence(const std::vector<int>&)’: user.cpp:25:5: error: ‘vector’ was not declared in this scope vector<int> best(v.size()); ^~~~~~ user.cpp:25:5: note: suggested alternative: In file included from /usr/include/c++/6/vector:64:0, from user.cpp:4: /usr/include/c++/6/bits/stl_vector.h:214:11: note: ‘std::vector’ class vector : protected _Vector_base<_Tp, _Alloc> ^~~~~~ user.cpp:25:12: error: expected primary-expression before ‘int’ vector<int> best(v.size()); ^~~ user.cpp:26:12: error: expected primary-expression before ‘int’ vector<int> prev(v.size()); ^~~ user.cpp:27:12: error: expected primary-expression before ‘int’ vector<int> state; ^~~ user.cpp:29:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int currIdx = 0; currIdx < v.size(); ++currIdx) { ~~~~~~~~^~~~~~~~~~ user.cpp:30:28: error: expected primary-expression before ‘;’ token int bestStateIdx = ; ^ user.cpp:32:29: error: ‘state’ was not declared in this scope if (bestStateIdx >= state.size()) { ^~~~~ user.cpp:39:9: error: ‘prev’ was not declared in this scope prev[currIdx] = bestStateIdx ? state[bestStateIdx - 1] : 0; ^~~~ user.cpp:39:9: note: suggested alternative: In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0, from /usr/include/c++/6/bits/char_traits.h:39, from /usr/include/c++/6/ios:40, from /usr/include/c++/6/ostream:38, from /usr/include/c++/6/iostream:39, from user.cpp:2: /usr/include/c++/6/bits/stl_iterator_base_funcs.h:217:5: note: ‘std::prev’ prev(_BidirectionalIterator __x, typename ^~~~ user.cpp:39:40: error: ‘state’ was not declared in this scope prev[currIdx] = bestStateIdx ? state[bestStateIdx - 1] : 0; ^~~~~ user.cpp:41:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ user.cpp: In function ‘int main()’: user.cpp:57:5: error: expected ‘;’ before ‘for’ for (auto i : lis) {

Ceva nu functioneaza?