Problem candyshop
User blackscreen1
Submission Time 2025-12-17 15:41:13
Score 0
Max Time N/A
Max Memory N/A

Compile Error

candyshop.cpp: In function ‘void dfs(long long int)’:
candyshop.cpp:17:27: error: no matching function for call to ‘std::set<long long int>::erase(std::set<long long int>::reverse_iterator)’
17 | s[x].erase(s[x].rbegin());
| ^
In file included from /usr/include/c++/9/set:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:87,
from candyshop.cpp:1:
/usr/include/c++/9/bits/stl_set.h:654:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::erase(std::set<_Key, _Compare, _Alloc>::const_iterator) [with _Key = long long int; _Compare = std::less<long long int>; _Alloc = std::allocator<long long int>; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<long long int>; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<long long int>]’