Problem exam2
User user123
Submission Time 2026-05-29 20:22:53
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exam2.cpp: In function ‘int minimum_dissatisfaction(int, std::vector<int>, std::vector<int>)’:
exam2.cpp:70:29: error: no matching function for call to ‘std::set<std::tuple<int, int, int> >::insert(<brace-enclosed initializer list>)’
70 | st.insert({A[i], B[i], i});
| ^
In file included from /usr/include/c++/9/set:61,
from exam2.cpp:5:
/usr/include/c++/9/bits/stl_set.h:509:7: note: candidate: ‘std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::tuple<int, int, int>; _Compare = std::less<std::tuple<int, int, int> >; _Alloc = std::allocator<std::tuple<int, int, int> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp&g