Problem candyshop
User bron
Submission Time 2023-01-01 16:20:31
Score 0
Max Time N/A
Max Memory N/A

Compile Error

candyshop.cpp: In function ‘int main()’:
candyshop.cpp:122:52: error: no match for ‘operator-’ (operand types are ‘long long int’ and ‘std::pair<long long int, long long int>’)
122 | for(int i=0;i<N;i++) root->update(pre[i],pre[i],i-root->query(pre[i],pre[i]));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | std::pair<long long int, long long int>
| long long 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 candyshop.cpp:1:
/usr/include/c++/9/bits/stl_iterator.h:41