Problem lis
User jeongwonho64
Submission Time 2023-06-29 12:56:16
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lis.cpp: In function ‘int longest_increasing_subsequence(std::vector<int>&)’:
lis.cpp:15:20: error: no match for ‘operator-’ (operand types are ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’ and ‘std::vector<int>’)
15 | ans[it - ans] = arr[i];
| ~~ ^ ~~~
| | |
| | std::vector<int>
| __gnu_cxx::__normal_iterator<int*, std::vector<int> >
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/specfun.h:45,
from /usr/include/c++/9/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from lis.cpp:2:
/usr/include/c++/9/bits/stl_iterator.h:864:7: note: candidate: ‘__gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container>