Problem routine
User TheInvadr
Submission Time 2024-12-29 10:49:04
Score 0
Max Time N/A
Max Memory N/A

Compile Error

routine.cpp: In function ‘int main()’:
routine.cpp:22:49: error: no matching function for call to ‘upper_bound(std::vector<int>::iterator, std::vector<int>::iterator)’
22 | int idx = (upper_bound(t.begin(),t.end())-t.begin());
| ^
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from routine.cpp:9:
/usr/include/c++/9/bits/stl_algo.h:2082:5: note: candidate: ‘template<class _FIter, class _Tp> _FIter std::upper_bound(_FIter, _FIter, const _Tp&)’
2082 | upper_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/9/bits/stl_algo.h:2082:5: note: template argument deduction/substitution failed:
routine.cpp:22:49: note: candidate expects 3 arguments, 2 provided
22 | int idx = (upper_bound(t.begin(),t.end())-t.begin(