제출 #937411

#제출 시각아이디문제언어결과실행 시간메모리
937411VinhLuuPalembang Bridges (APIO15_bridge)C++17
컴파일 에러
0 ms0 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <bits/stdc++.h> #define int long long #define ll long long #define fi first #define se second #define pb push_back #define all(lmao) lmao.begin(), lmao.end() using namespace std; typedef pair<int,int> pii; typedef tuple<int,int,int> tp; const int N = 2e5 + 5; const ll oo = 1e18; const int mod = 1e9 + 7; const int K = 1e5 + 5; char P[N], Q[N]; int S[N], T[N], k, n; ll ans, s[N]; vector<ll> vr; vector<pii> h; int cnt = 0; namespace sub1{ void solve(){ ll ret = oo; for(int i = 1; i <= cnt << 1; i ++){ for(int j = i + 1; j <= cnt << 1; j ++){ ll kq = 0; for(auto [l, r] : h){ if(l <= vr[i - 1] && vr[i - 1] <= r) kq += 1 + vr[i - 1] - l + r - vr[i - 1]; else if(l <= vr[j - 1] && vr[j - 1] <= r) kq += 1 + vr[j - 1] - l + r - vr[j - 1]; else if(vr[i - 1] <= l && r <= vr[j - 1]) kq += 1 + min(l - vr[i - 1] + r - vr[i - 1], vr[j - 1] - l + vr[j - 1] - r); else if(r <= vr[i - 1]) kq += 1 + vr[i - 1] - l + vr[i - 1] - r; else kq += 1 + l - vr[j - 1] + r - vr[j - 1]; } ret = min(ret, kq + ans); } } ans = ret; } } namespace sub3{ ll cal(int i,int j){ ll kq = 0; for(auto [l, r] : h){ if(l <= i && i <= r) kq += 1 + i - l + r - i; else if(l <= j && j <= r) kq += 1 + j - l + r - j; else if(i <= l && r <= j) kq += 1 + min(l - i + r - i, j - l + j - r); else if(r <= i) kq += 1 + i - l + i - r; else kq += 1 + l - j + r - j; } return kq; } pii g[N]; vector<int> op[N], w[N], cl[N]; void solve(){ sort(vr.begin(), vr.end(), [] (pii x, pii y){return x.se == y.se ? x.fi < y.fi : x.se < y.se;}); int t = 0; for(auto j : vr){ op[j.fi].pb(j.se); cl[j.se].pb(j.fi); g[++t] = j, p[t] = j.se; } ll ret = oo; for(int i = 1; i <= cnt * 2; i ++){ int l = vr[i - 1] + 1; int r = min((int)1e9, vr[cnt * 2 - 1] + 1); while(l < r - 2){ int m1 = l + (r - l)/3, m2 = r - (r - l)/3; ll u = cal(vr[i - 1], m1); ll v = cal(vr[i - 1], m2); if(u > v) l = m1; else r = m2; ret = min({ret, u, v}); } for(int j = l; j <= r; j ++) ret = min(ret, cal(vr[i - 1], j)); // cerr << i << " " << ret << "f\n"; } ans = ret + ans; } } namespace sub2{ ll cal(int i,int j){ ll kq = 0; for(auto [l, r] : h){ if(l <= i && i <= r) kq += 1 + i - l + r - i; else if(l <= j && j <= r) kq += 1 + j - l + r - j; else if(i <= l && r <= j) kq += 1 + min(l - i + r - i, j - l + j - r); else if(r <= i) kq += 1 + i - l + i - r; else kq += 1 + l - j + r - j; } return kq; } void solve(){ ll ret = oo; for(int i = 1; i <= cnt * 2; i ++){ int l = vr[i - 1] + 1; int r = min((int)1e9, vr[cnt * 2 - 1] + 1); while(l < r - 2){ int m1 = l + (r - l)/3, m2 = r - (r - l)/3; ll u = cal(vr[i - 1], m1); ll v = cal(vr[i - 1], m2); if(u > v) l = m1; else r = m2; ret = min({ret, u, v}); } for(int j = l; j <= r; j ++) ret = min(ret, cal(vr[i - 1], j)); // cerr << i << " " << ret << "f\n"; } ans = ret + ans; } } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define task "v" if(fopen(task ".inp","r")){ freopen(task ".inp","r",stdin); freopen(task ".out","w",stdout); } cin >> k >> n; for(int i = 1; i <= n; i ++){ cin >> P[i] >> S[i] >> Q[i] >> T[i]; if(P[i] == Q[i]){ ans += abs(S[i] - T[i]); continue; } vr.pb(S[i]); vr.pb(T[i]); cnt++; if(S[i] > T[i]) swap(S[i], T[i]); h.pb({S[i], T[i]}); } if(!vr.empty()){ sort(vr.begin(), vr.end()); for(int i = 1; i <= cnt * 2; i ++) s[i] = s[i - 1] + vr[i - 1]; if(k == 1){ ll kq = oo; ll lim = vr[cnt - 1]; for(int j = max(vr[0], lim - (ll)1); j <= min(vr[2 * cnt - 1], lim + (ll)1); j ++){ int i = lower_bound(all(vr), j) - vr.begin(); if(i < 2 * cnt){ i++; } kq = min(kq, cnt + 1ll * j * (i - 1) - 1ll * j * (1ll * 2 * cnt - i + 1) - s[i - 1] + s[cnt * 2] - s[i - 1]); } ans = ans + kq; }else{ // if(n <= 100) sub1 :: solve(); // else if(n <= 1000) sub2 :: solve(); else } } cout << ans; }

컴파일 시 표준 에러 (stderr) 메시지

bridge.cpp: In function 'void sub3::solve()':
bridge.cpp:8:12: error: request for member 'first' in 'j', which is of non-class type 'long long int'
    8 | #define fi first
      |            ^~~~~
bridge.cpp:66:18: note: in expansion of macro 'fi'
   66 |             op[j.fi].pb(j.se);
      |                  ^~
bridge.cpp:9:12: error: request for member 'second' in 'j', which is of non-class type 'long long int'
    9 | #define se second
      |            ^~~~~~
bridge.cpp:66:27: note: in expansion of macro 'se'
   66 |             op[j.fi].pb(j.se);
      |                           ^~
bridge.cpp:9:12: error: request for member 'second' in 'j', which is of non-class type 'long long int'
    9 | #define se second
      |            ^~~~~~
bridge.cpp:67:18: note: in expansion of macro 'se'
   67 |             cl[j.se].pb(j.fi);
      |                  ^~
bridge.cpp:8:12: error: request for member 'first' in 'j', which is of non-class type 'long long int'
    8 | #define fi first
      |            ^~~~~
bridge.cpp:67:27: note: in expansion of macro 'fi'
   67 |             cl[j.se].pb(j.fi);
      |                           ^~
bridge.cpp:68:22: error: no match for 'operator=' (operand types are 'pii' {aka 'std::pair<long long int, long long int>'} and 'long long int')
   68 |             g[++t] = j, p[t] = j.se;
      |                      ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from bridge.cpp:5:
/usr/include/c++/10/bits/stl_pair.h:390:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(typename std::conditional<std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type) [with _T1 = long long int; _T2 = long long int; typename std::conditional<std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value, const std::pair<_T1, _T2>&, const std::__nonesuch&>::type = const std::pair<long long int, long long int>&]'
  390 |       operator=(typename conditional<
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:393:41: note:   no known conversion for argument 1 from 'long long int' to 'std::conditional<true, const std::pair<long long int, long long int>&, const std::__nonesuch&>::type' {aka 'const std::pair<long long int, long long int>&'}
  390 |       operator=(typename conditional<
      |                 ~~~~~~~~~~~~~~~~~~~~~    
  391 |   __and_<is_copy_assignable<_T1>,
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
  392 |          is_copy_assignable<_T2>>::value,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  393 |   const pair&, const __nonesuch&>::type __p)
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_pair.h:401:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(typename std::conditional<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value, std::pair<_T1, _T2>&&, std::__nonesuch&&>::type) [with _T1 = long long int; _T2 = long long int; typename std::conditional<std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value, std::pair<_T1, _T2>&&, std::__nonesuch&&>::type = std::pair<long long int, long long int>&&]'
  401 |       operator=(typename conditional<
      |       ^~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:404:31: note:   no known conversion for argument 1 from 'long long int' to 'std::conditional<true, std::pair<long long int, long long int>&&, std::__nonesuch&&>::type' {aka 'std::pair<long long int, long long int>&&'}
  401 |       operator=(typename conditional<
      |                 ~~~~~~~~~~~~~~~~~~~~~
  402 |   __and_<is_move_assignable<_T1>,
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  403 |          is_move_assignable<_T2>>::value,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  404 |   pair&&, __nonesuch&&>::type __p)
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_pair.h:418:2: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = long long int; _T2 = long long int]'
  418 |  operator=(const pair<_U1, _U2>& __p)
      |  ^~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:418:2: note:   template argument deduction/substitution failed:
bridge.cpp:68:22: note:   mismatched types 'const std::pair<_T1, _T2>' and 'long long int'
   68 |             g[++t] = j, p[t] = j.se;
      |                      ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from bridge.cpp:5:
/usr/include/c++/10/bits/stl_pair.h:430:2: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = long long int; _T2 = long long int]'
  430 |  operator=(pair<_U1, _U2>&& __p)
      |  ^~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:430:2: note:   template argument deduction/substitution failed:
bridge.cpp:68:22: note:   mismatched types 'std::pair<_T1, _T2>' and 'long long int'
   68 |             g[++t] = j, p[t] = j.se;
      |                      ^
bridge.cpp:68:25: error: 'p' was not declared in this scope
   68 |             g[++t] = j, p[t] = j.se;
      |                         ^
bridge.cpp:9:12: error: request for member 'second' in 'j', which is of non-class type 'long long int'
    9 | #define se second
      |            ^~~~~~
bridge.cpp:68:34: note: in expansion of macro 'se'
   68 |             g[++t] = j, p[t] = j.se;
      |                                  ^~
bridge.cpp: In function 'int main()':
bridge.cpp:163:9: error: expected primary-expression before '}' token
  163 |         }
      |         ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:71,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from bridge.cpp:5:
/usr/include/c++/10/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Iterator2 = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = sub3::solve()::<lambda(pii, pii)>]':
/usr/include/c++/10/bits/stl_algo.h:82:17:   required from 'void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1924:34:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1958:38:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1974:25:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:4892:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = sub3::solve()::<lambda(pii, pii)>]'
bridge.cpp:64:103:   required from here
/usr/include/c++/10/bits/predefined_ops.h:156:30: error: no match for call to '(sub3::solve()::<lambda(pii, pii)>) (long long int&, long long int&)'
  156 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/predefined_ops.h:156:30: note: candidate: 'bool (*)(pii, pii)' {aka 'bool (*)(std::pair<long long int, long long int>, std::pair<long long int, long long int>)'} (conversion)
/usr/include/c++/10/bits/predefined_ops.h:156:30: note:   candidate expects 3 arguments, 3 provided
bridge.cpp:64:36: note: candidate: 'sub3::solve()::<lambda(pii, pii)>'
   64 |         sort(vr.begin(), vr.end(), [] (pii x, pii y){return x.se == y.se ? x.fi < y.fi : x.se < y.se;});
      |                                    ^
bridge.cpp:64:36: note:   no known conversion for argument 1 from 'long long int' to 'pii' {aka 'std::pair<long long int, long long int>'}
In file included from /usr/include/c++/10/bits/stl_algobase.h:71,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from bridge.cpp:5:
/usr/include/c++/10/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = long long int; _Iterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = sub3::solve()::<lambda(pii, pii)>]':
/usr/include/c++/10/bits/stl_algo.h:1826:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Val_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1854:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1886:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1977:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:4892:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = sub3::solve()::<lambda(pii, pii)>]'
bridge.cpp:64:103:   required from here
/usr/include/c++/10/bits/predefined_ops.h:238:23: error: no match for call to '(sub3::solve()::<lambda(pii, pii)>) (long long int&, long long int&)'
  238 |  { return bool(_M_comp(__val, *__it)); }
      |                ~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/10/bits/predefined_ops.h:238:23: note: candidate: 'bool (*)(pii, pii)' {aka 'bool (*)(std::pair<long long int, long long int>, std::pair<long long int, long long int>)'} (conversion)
/usr/include/c++/10/bits/predefined_ops.h:238:23: note:   candidate expects 3 arguments, 3 provided
bridge.cpp:64:36: note: candidate: 'sub3::solve()::<lambda(pii, pii)>'
   64 |         sort(vr.begin(), vr.end(), [] (pii x, pii y){return x.se == y.se ? x.fi < y.fi : x.se < y.se;});
      |                                    ^
bridge.cpp:64:36: note:   no known conversion for argument 1 from 'long long int' to 'pii' {aka 'std::pair<long long int, long long int>'}
In file included from /usr/include/c++/10/bits/stl_algobase.h:71,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from bridge.cpp:5:
/usr/include/c++/10/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Value = long long int; _Compare = sub3::solve()::<lambda(pii, pii)>]':
/usr/include/c++/10/bits/stl_heap.h:139:48:   required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Distance = long int; _Tp = long long int; _Compare = __gnu_cxx::__ops::_Iter_comp_val<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_heap.h:246:23:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Distance = long int; _Tp = long long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_heap.h:355:22:   required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1666:23:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1937:25:   required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1953:27:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:1974:25:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<sub3::solve()::<lambda(pii, pii)> >]'
/usr/include/c++/10/bits/stl_algo.h:4892:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >; _Compare = sub3::solve()::<lambda(pii, pii)>]'
bridge.cpp:64:103:   required from here
/usr/include/c++/10/bits/predefined_ops.h:194:23: error: no match for call to '(sub3::solve()::<lambda(pii, pii)>) (long long int&, long long int&)'
  194 |  { return bool(_M_comp(*__it, __val)); }
      |                ~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/10/bits/predefined_ops.h:194:23: note: candidate: 'bool (*)(pii, pii)' {aka 'bool (*)(std::pair<long long int, long long int>, std::pair<long long int, long long int>)'} (conversion)
/usr/include/c++/10/bits/predefined_ops.h:194:23: note:   candidate expects 3 arguments, 3 provided
bridge.cpp:64:36: note: candidate: 'sub3::solve()::<lambda(pii, pii)>'
   64 |         sort(vr.begin(), vr.end(), [] (pii x, pii y){return x.se == y.se ? x.fi < y.fi : x.se < y.se;});
      |                                    ^
bridge.cpp:64:36: note:   no known conversion for argument 1 from 'long long int' to 'pii' {aka 'std::pair<long long int, long long int>'}
bridge.cpp:125:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  125 |         freopen(task ".inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
bridge.cpp:126:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  126 |         freopen(task ".out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~