Submission #842964

#TimeUsernameProblemLanguageResultExecution timeMemory
842964coding_snorlaxLongest Trip (IOI23_longesttrip)C++17
Compilation error
0 ms0 KiB
#include "longesttrip.h" #include<bits/stdc++.h> using namespace std; set<int> un_process; vector<int> B_complex_graph(vector<int> A,vector<int> B){ set<int> test; vector<int> test_1; for(int i:A){ test.insert(i); if(test.find(A)!=test.end()) return test_1; } for(int i:B){ if(test.find(A)!=test.end()) return test_1; test.insert(i) } // B is a complex_graph set vector<int> tmp={0},tmp1={0}; tmp[0] = A[0]; if(!are_connected(tmp,B)){ // now A[0],A.back() connected // only need to find one edge between A and B or return no such edge int L = 0;int R = (int) B.size()-1;int M = (L+R)/2; while(L!=R){ vector<int> query; M = (L+R)/2; for(int i=L;i<=M;i++){ query.push_back(B[i]); } if(!are_connected(A,query)) L = M+1; else R = M; } int l = 0;int r = (int) A.size()-1;int m = (L+R)/2; while(l!=r){ vector<int> query; m = (l+r)/2; for(int i=l;i<=m;i++){ query.push_back(A[i]); } tmp[0]=B[L]; if(!are_connected(query,tmp)) l = m+1; else r = m; } tmp1[0]=l; tmp[0]=B[L]; if(are_connected(tmp1,tmp)){ vector<int> answer; for(int i=0;i<(int)A.size();i++) answer.push_back(A[(i+l+1)%((int)A.size())]); answer.push_back(B[L]); for(int i=0;i<(int)B.size()-1;i++) answer.push_back(B[(i+L+1)%((int)B.size())]); return answer; } else{ return A; } } else{ int L = 0;int R = (int) B.size()-1;int M = (L+R)/2; while(L!=R){ vector<int> query; M = (L+R)/2; for(int i=L;i<=M;i++){ query.push_back(B[i]); } if(!are_connected(tmp,query)) L = M+1; else R = M; } vector<int> answer; for(int i=(int)A.size()-1;i>=0;i--) answer.push_back(A[i]); answer.push_back(B[R]); //cout << "B_size" << (int)B.size() << "\n"; for(int i=0;i<(int)B.size()-1;i++) answer.push_back(B[(i+R+1)%((int)B.size())]); return answer; } } vector<int> Process(vector<int> C,vector<int> D){ if((int)D.size()==0) {return C;} vector<int> A,B; if((int)C.size()<(int)D.size()){A=D;B=C;} else{A=C;B=D;} vector<int> tmp = {1}; tmp[0] = A.back(); if(!are_connected(tmp,B)){ return B_complex_graph(A,B); } else{ int L = 0;int R = (int) B.size()-1;int M = (L+R)/2; while(L!=R){ vector<int> query; M = (L+R)/2; cout << M << " \n"; for(int i=L;i<=M;i++){ query.push_back(B[i]); } if(!are_connected(tmp,query)) L = M+1; else R = M; } vector<int> new_B; if(L > (int)B.size()/2){ for(int i=L;i>=0;i--){ A.push_back(B[i]); } for(int i=L+1;i<(int)B.size();i++){ new_B.push_back(B[i]); } } else{ for(int i=L;i<(int)B.size();i++){ A.push_back(B[i]); } for(int i=L-1;i>=0;i--){ new_B.push_back(B[i]); } } return Process(A,new_B); } } vector<int> longest_trip(int N, int D) { un_process.clear(); for(int i=2;i<N;i++){ un_process.insert(i); } vector<int> a={0}; vector<int> b={1}; while((int)un_process.size()>=1){ vector<int> ask1 = {a.back()}; vector<int> ask2 = {b.back(),*un_process.begin()}; if(are_connected(ask1,ask2)){ vector<int> ask3 = {a.back()}; vector<int> ask4 = {*un_process.begin()}; if(are_connected(ask3,ask4)) a.push_back(*un_process.begin()); else{ for(int i = (int)b.size()-1;i>=0;i--) a.push_back(b[i]); b.clear(); b.push_back(*un_process.begin()); } } else{ b.push_back(*un_process.begin()); } un_process.erase(un_process.begin()); } return Process(a,b); }

Compilation message (stderr)

longesttrip.cpp: In function 'std::vector<int> B_complex_graph(std::vector<int>, std::vector<int>)':
longesttrip.cpp:10:23: error: no matching function for call to 'std::set<int>::find(std::vector<int>&)'
   10 |         if(test.find(A)!=test.end()) return test_1;
      |                       ^
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_set.h:794:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = int]'
  794 |       find(const key_type& __x)
      |       ^~~~
/usr/include/c++/10/bits/stl_set.h:794:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const key_type&' {aka 'const int&'}
  794 |       find(const key_type& __x)
      |            ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:798:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = int]'
  798 |       find(const key_type& __x) const
      |       ^~~~
/usr/include/c++/10/bits/stl_set.h:798:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const key_type&' {aka 'const int&'}
  798 |       find(const key_type& __x) const
      |            ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:804:2: note: candidate: 'template<class _Kt> decltype (std::set<_Key, _Compare, _Alloc>::iterator{((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_find_tr(__x)}) std::set<_Key, _Compare, _Alloc>::find(const _Kt&) [with _Kt = _Kt; _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
  804 |  find(const _Kt& __x)
      |  ^~~~
/usr/include/c++/10/bits/stl_set.h:804:2: note:   template argument deduction/substitution failed:
/usr/include/c++/10/bits/stl_set.h: In substitution of 'template<class _Kt> decltype (std::set<int>::iterator{((std::set<int>*)this)->std::set<int>::_M_t.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(__x)}) std::set<int>::find<_Kt>(const _Kt&) [with _Kt = std::vector<int>]':
longesttrip.cpp:10:23:   required from here
/usr/include/c++/10/bits/stl_set.h:805:38: error: no matching function for call to 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(const std::vector<int>&)'
  805 |  -> decltype(iterator{_M_t._M_find_tr(__x)})
      |                       ~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/10/map:60,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_tree.h:1301:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
 1301 |  _M_find_tr(const _Kt& __k)
      |  ^~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:1301:2: note:   template argument deduction/substitution failed:
/usr/include/c++/10/bits/stl_tree.h: In substitution of 'template<class _Cmp, class _SfinaeType> using __has_is_transparent_t = typename std::__has_is_transparent<_Cmp, _SfinaeType>::type [with _Cmp = std::less<int>; _SfinaeType = std::vector<int>]':
/usr/include/c++/10/bits/stl_tree.h:1299:9:   required by substitution of 'template<class _Kt> decltype (std::set<int>::iterator{((std::set<int>*)this)->std::set<int>::_M_t.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(__x)}) std::set<int>::find<_Kt>(const _Kt&) [with _Kt = std::vector<int>]'
longesttrip.cpp:10:23:   required from here
/usr/include/c++/10/bits/stl_tree.h:429:11: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<int>, std::vector<int>, void>'
  429 |     using __has_is_transparent_t
      |           ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_set.h: In substitution of 'template<class _Kt> decltype (std::set<int>::iterator{((std::set<int>*)this)->std::set<int>::_M_t.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(__x)}) std::set<int>::find<_Kt>(const _Kt&) [with _Kt = std::vector<int>]':
longesttrip.cpp:10:23:   required from here
/usr/include/c++/10/bits/stl_tree.h:1310:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Kt = _Kt; _Req = _Req; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
 1310 |  _M_find_tr(const _Kt& __k) const
      |  ^~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:1310:2: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_set.h:804:2: error: no matching function for call to 'std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(<brace-enclosed initializer list>)'
  804 |  find(const _Kt& __x)
      |  ^~~~
In file included from /usr/include/c++/10/map:60,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_tree.h:350:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator(const iterator&) [with _Tp = int; std::_Rb_tree_const_iterator<_Tp>::iterator = std::_Rb_tree_const_iterator<int>::iterator]'
  350 |       _Rb_tree_const_iterator(const iterator& __it) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:350:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:347:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator(std::_Rb_tree_const_iterator<_Tp>::_Base_ptr) [with _Tp = int; std::_Rb_tree_const_iterator<_Tp>::_Base_ptr = const std::_Rb_tree_node_base*]'
  347 |       _Rb_tree_const_iterator(_Base_ptr __x) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:347:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:343:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator() [with _Tp = int]'
  343 |       _Rb_tree_const_iterator() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:343:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/10/bits/stl_tree.h:328:12: note: candidate: 'constexpr std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(const std::_Rb_tree_const_iterator<int>&)'
  328 |     struct _Rb_tree_const_iterator
      |            ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:328:12: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:328:12: note: candidate: 'constexpr std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(std::_Rb_tree_const_iterator<int>&&)'
/usr/include/c++/10/bits/stl_tree.h:328:12: note:   conversion of argument 1 would be ill-formed:
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_set.h:810:2: note: candidate: 'template<class _Kt> decltype (std::set<_Key, _Compare, _Alloc>::const_iterator{((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_find_tr(__x)}) std::set<_Key, _Compare, _Alloc>::find(const _Kt&) const [with _Kt = _Kt; _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
  810 |  find(const _Kt& __x) const
      |  ^~~~
/usr/include/c++/10/bits/stl_set.h:810:2: note:   template argument deduction/substitution failed:
/usr/include/c++/10/bits/stl_set.h: In substitution of 'template<class _Kt> decltype (std::set<int>::const_iterator{((const std::set<int>*)this)->std::set<int>::_M_t.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(__x)}) std::set<int>::find<_Kt>(const _Kt&) const [with _Kt = std::vector<int>]':
longesttrip.cpp:10:23:   required from here
/usr/include/c++/10/bits/stl_set.h:811:44: error: no matching function for call to 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(const std::vector<int>&) const'
  811 |  -> decltype(const_iterator{_M_t._M_find_tr(__x)})
      |                             ~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/10/map:60,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_tree.h:1301:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
 1301 |  _M_find_tr(const _Kt& __k)
      |  ^~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:1301:2: note:   template argument deduction/substitution failed:
/usr/include/c++/10/bits/stl_tree.h:1310:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Kt = _Kt; _Req = _Req; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
 1310 |  _M_find_tr(const _Kt& __k) const
      |  ^~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:1310:2: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_set.h:810:2: error: no matching function for call to 'std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(<brace-enclosed initializer list>)'
  810 |  find(const _Kt& __x) const
      |  ^~~~
In file included from /usr/include/c++/10/map:60,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_tree.h:350:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator(const iterator&) [with _Tp = int; std::_Rb_tree_const_iterator<_Tp>::iterator = std::_Rb_tree_const_iterator<int>::iterator]'
  350 |       _Rb_tree_const_iterator(const iterator& __it) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:350:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:347:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator(std::_Rb_tree_const_iterator<_Tp>::_Base_ptr) [with _Tp = int; std::_Rb_tree_const_iterator<_Tp>::_Base_ptr = const std::_Rb_tree_node_base*]'
  347 |       _Rb_tree_const_iterator(_Base_ptr __x) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:347:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:343:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator() [with _Tp = int]'
  343 |       _Rb_tree_const_iterator() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:343:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/10/bits/stl_tree.h:328:12: note: candidate: 'constexpr std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(const std::_Rb_tree_const_iterator<int>&)'
  328 |     struct _Rb_tree_const_iterator
      |            ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:328:12: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:328:12: note: candidate: 'constexpr std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(std::_Rb_tree_const_iterator<int>&&)'
/usr/include/c++/10/bits/stl_tree.h:328:12: note:   conversion of argument 1 would be ill-formed:
longesttrip.cpp:13:23: error: no matching function for call to 'std::set<int>::find(std::vector<int>&)'
   13 |         if(test.find(A)!=test.end()) return test_1;
      |                       ^
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_set.h:794:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = int]'
  794 |       find(const key_type& __x)
      |       ^~~~
/usr/include/c++/10/bits/stl_set.h:794:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const key_type&' {aka 'const int&'}
  794 |       find(const key_type& __x)
      |            ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:798:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator; std::set<_Key, _Compare, _Alloc>::key_type = int]'
  798 |       find(const key_type& __x) const
      |       ^~~~
/usr/include/c++/10/bits/stl_set.h:798:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const key_type&' {aka 'const int&'}
  798 |       find(const key_type& __x) const
      |            ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_set.h:804:2: note: candidate: 'template<class _Kt> decltype (std::set<_Key, _Compare, _Alloc>::iterator{((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_find_tr(__x)}) std::set<_Key, _Compare, _Alloc>::find(const _Kt&) [with _Kt = _Kt; _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
  804 |  find(const _Kt& __x)
      |  ^~~~
/usr/include/c++/10/bits/stl_set.h:804:2: note:   template argument deduction/substitution failed:
/usr/include/c++/10/bits/stl_set.h: In substitution of 'template<class _Kt> decltype (std::set<int>::iterator{((std::set<int>*)this)->std::set<int>::_M_t.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(__x)}) std::set<int>::find<_Kt>(const _Kt&) [with _Kt = std::vector<int>]':
longesttrip.cpp:13:23:   required from here
/usr/include/c++/10/bits/stl_set.h:805:38: error: no matching function for call to 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_find_tr(const std::vector<int>&)'
  805 |  -> decltype(iterator{_M_t._M_find_tr(__x)})
      |                       ~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/10/map:60,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_tree.h:1301:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
 1301 |  _M_find_tr(const _Kt& __k)
      |  ^~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:1301:2: note:   template argument deduction/substitution failed:
/usr/include/c++/10/bits/stl_tree.h:1310:2: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Kt = _Kt; _Req = _Req; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
 1310 |  _M_find_tr(const _Kt& __k) const
      |  ^~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:1310:2: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_set.h:804:2: error: no matching function for call to 'std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(<brace-enclosed initializer list>)'
  804 |  find(const _Kt& __x)
      |  ^~~~
In file included from /usr/include/c++/10/map:60,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from longesttrip.cpp:2:
/usr/include/c++/10/bits/stl_tree.h:350:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator(const iterator&) [with _Tp = int; std::_Rb_tree_const_iterator<_Tp>::iterator = std::_Rb_tree_const_iterator<int>::iterator]'
  350 |       _Rb_tree_const_iterator(const iterator& __it) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:350:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:347:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator(std::_Rb_tree_const_iterator<_Tp>::_Base_ptr) [with _Tp = int; std::_Rb_tree_const_iterator<_Tp>::_Base_ptr = const std::_Rb_tree_node_base*]'
  347 |       _Rb_tree_const_iterator(_Base_ptr __x) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:347:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/10/bits/stl_tree.h:343:7: note: candidate: 'std::_Rb_tree_const_iterator<_Tp>::_Rb_tree_const_iterator() [with _Tp = int]'
  343 |       _Rb_tree_const_iterator() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:343:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/10/bits/stl_tree.h:328:12: note: candidate: 'constexpr std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(const std::_Rb_tree_const_iter