Submission #943247

#TimeUsernameProblemLanguageResultExecution timeMemory
943247WongYiKaiPortals (BOI14_portals)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll r,c; ll a(ll i, ll j) { return (i)*(c+2)+j; } pair<ll,ll> ra(ll x) { return {(x)/(c+2),(x)%(c+2)}; } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> r >> c; //if (r*c>100) return 0; ll grid[r+5][c+5]; ll s,e; memset(grid,0,sizeof(grid)); for (int i=1;i<=r;i++){ string temp; cin >> temp; for (int j=1;j<=c;j++){ if (temp[j-1]=='.') grid[i][j] = 1; else if (temp[j-1]=='#') grid[i][j] = 0; else if (temp[j-1]=='C') { grid[i][j] = 1; e = a(i,j); } else{ grid[i][j] = 1; s = a(i,j); } } } ll visited[r*c+r+r+c+c+10]; queue<pair<ll,ll>> bfs; memset(visited,0,sizeof(visited)); for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ if (grid[i][j]==0) continue; ll check=0; if (grid[i-1][j]==0) check=1; else if (grid[i+1][j]==0) check=1; else if (grid[i][j-1]==0) check=1; else if (grid[i][j+1]==0) check=1; if (check==0) continue; bfs.push({a(i,j),0}); visited[a(i,j)]=1; } } ll dist[r*c+r+r+c+c+10]; memset(dist,-1,sizeof(dist)); while (!bfs.empty()){ ll x = bfs.front().first; ll rnk = bfs.front().second; dist[x] = rnk; bfs.pop(); ll item; pair<ll,ll> temp; item=x-1; if (visited[item]==0){ temp = ra(item); if (grid[temp.first][temp.second]==1){ visited[item] = 1; bfs.push({item,rnk+1}); } } item=x+1; if (visited[item]==0){ temp = ra(item); if (grid[temp.first][temp.second]==1){ visited[item] = 1; bfs.push({item,rnk+1}); } } item=x-c-2; if (visited[item]==0){ temp = ra(item); if (grid[temp.first][temp.second]==1){ visited[item] = 1; bfs.push({item,rnk+1}); } } item=x+c+2; if (visited[item]==0){ temp = ra(item); if (grid[temp.first][temp.second]==1){ visited[item] = 1; bfs.push({item,rnk+1}); } } } /* for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ cout << dist[a(i,j)] << " "; } cout << "\n"; } */ ll left[r*c+r+r+c+c+10],right[r*c+r+r+c+c+10],up[r*c+r+r+c+c+10],down[r*c+r+r+c+c+10]; for (int j=1;j<=c;j++) up[a(0,j)] = a(0,j); for (int i=1;i<=r;i++){ if (grid[i][1]==0) { left[a(i,1)]=a(i,1); up[a(i,1)]=a(i,1); } else { left[a(i,1)]=a(i,0); up[a(i,1)] = up[a(i-1,1)]; } for (int j=2;j<=c;j++){ if (grid[i][j]==0) { left[a(i,j)] = a(i,j); up[a(i,j)] = a(i,j); } else { left[a(i,j)] = left[a(i,j-1)]; up[a(i,j)] = up[a(i-1,j)]; } } } //right down for (int j=1;j<=c;j++) down[a(r+1,j)] = a(r+1,j); for (int i=r;i>=1;i--){ if (grid[i][c]==0) { right[a(i,c)]=a(i,c); down[a(i,c)]=a(i,c); } else { right[a(i,c)]=a(i,c+1); down[a(i,c)] = down[a(i+1,c)]; } for (int j=c-1;j>=1;j--){ if (grid[i][j]==0) { right[a(i,j)] = a(i,j); down[a(i,j)] = a(i,j); } else { right[a(i,j)] = right[a(i,j+1)]; down[a(i,j)] = down[a(i+1,j)]; } } } /* cout << "left\n"; for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ cout << ra(left[a(i,j)]).first << "," << ra(left[a(i,j)]).second << " "; } cout << "\n"; } cout << "right\n"; for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ cout << ra(right[a(i,j)]).first << "," << ra(right[a(i,j)]).second << " "; } cout << "\n"; } cout << "down\n"; for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ cout << ra(down[a(i,j)]).first << "," << ra(down[a(i,j)]).second << " "; } cout << "\n"; } cout << "up\n"; for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ cout << ra(up[a(i,j)]).first << "," << ra(up[a(i,j)]).second << " "; } cout << "\n"; } */ vector<pair<ll,ll>> adj[r*c*5]; for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ if (grid[i][j]==0) continue; ll x = a(i,j); ll item; pair<ll,ll> temp; item=x-1; temp = ra(item); if (grid[temp.first][temp.second]==1){ adj[x].push_back({item,1}); } item=x+1; temp = ra(item); if (grid[temp.first][temp.second]==1){ adj[x].push_back({item,1}); } item=x-c-2; temp = ra(item); if (grid[temp.first][temp.second]==1){ adj[x].push_back({item,1}); } item=x+c+2; temp = ra(item); if (grid[temp.first][temp.second]==1){ adj[x].push_back({item,1}); } adj[x].push_back({left[x]+1,max(0,dist[x])+1}); adj[x].push_back({down[x]-c-2,max(0,dist[x])+1}); adj[x].push_back({up[x]+c+2,max(0,dist[x])+1}); adj[x].push_back({right[x]-1,max(0,dist[x])+1}); } } /* for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ cout << i << "," << j << ": "; for (auto item:adj[a(i,j)]){ cout << ra(item.first).first << "," << ra(item.first).second << "," << item.second << " "; } cout << "\n"; } } */ ll dis[r*c*5]; priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> pq; memset(dis,-1,sizeof(dis)); dis[s]=0; pq.push({0,s}); while (!pq.empty()) { pair<ll,ll> cur = pq.top(); pq.pop(); ll x = cur.second, d = cur.first; if (d>dis[x]) continue; for (vector<pair<ll,ll>>::iterator it=adj[x].begin();it!=adj[x].end();++it){ ll nx = it->first, nd = d+it->second; if (dis[nx]!=-1 && dis[nx]<=nd) continue; dis[nx] = nd; pq.push({nd,nx}); } } /* for (int i=1;i<=r;i++){ for (int j=1;j<=c;j++){ cout << dis[a(i,j)] << " "; } cout << "\n"; } */ cout << dis[e]; //cout << "a"; }

Compilation message (stderr)

portals.cpp: In function 'int main()':
portals.cpp:206:45: error: no matching function for call to 'max(int, ll&)'
  206 |    adj[x].push_back({left[x]+1,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
portals.cpp:206:45: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  206 |    adj[x].push_back({left[x]+1,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
portals.cpp:206:45: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  206 |    adj[x].push_back({left[x]+1,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
portals.cpp:206:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  206 |    adj[x].push_back({left[x]+1,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
portals.cpp:206:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  206 |    adj[x].push_back({left[x]+1,max(0,dist[x])+1});
      |                                             ^
portals.cpp:206:49: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(<brace-enclosed initializer list>)'
  206 |    adj[x].push_back({left[x]+1,max(0,dist[x])+1});
      |                                                 ^
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]'
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<long long int, long long int>&'}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]'
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<long long int, long long int> >::value_type&&' {aka 'std::pair<long long int, long long int>&&'}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
portals.cpp:207:47: error: no matching function for call to 'max(int, ll&)'
  207 |    adj[x].push_back({down[x]-c-2,max(0,dist[x])+1});
      |                                               ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
portals.cpp:207:47: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  207 |    adj[x].push_back({down[x]-c-2,max(0,dist[x])+1});
      |                                               ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
portals.cpp:207:47: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  207 |    adj[x].push_back({down[x]-c-2,max(0,dist[x])+1});
      |                                               ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
portals.cpp:207:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  207 |    adj[x].push_back({down[x]-c-2,max(0,dist[x])+1});
      |                                               ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
portals.cpp:207:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  207 |    adj[x].push_back({down[x]-c-2,max(0,dist[x])+1});
      |                                               ^
portals.cpp:207:51: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(<brace-enclosed initializer list>)'
  207 |    adj[x].push_back({down[x]-c-2,max(0,dist[x])+1});
      |                                                   ^
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]'
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<long long int, long long int>&'}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]'
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<long long int, long long int> >::value_type&&' {aka 'std::pair<long long int, long long int>&&'}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
portals.cpp:208:45: error: no matching function for call to 'max(int, ll&)'
  208 |    adj[x].push_back({up[x]+c+2,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
portals.cpp:208:45: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  208 |    adj[x].push_back({up[x]+c+2,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
portals.cpp:208:45: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  208 |    adj[x].push_back({up[x]+c+2,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
portals.cpp:208:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  208 |    adj[x].push_back({up[x]+c+2,max(0,dist[x])+1});
      |                                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
portals.cpp:208:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  208 |    adj[x].push_back({up[x]+c+2,max(0,dist[x])+1});
      |                                             ^
portals.cpp:208:49: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(<brace-enclosed initializer list>)'
  208 |    adj[x].push_back({up[x]+c+2,max(0,dist[x])+1});
      |                                                 ^
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]'
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<long long int, long long int>&'}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long long int, long long int>]'
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<long long int, long long int> >::value_type&&' {aka 'std::pair<long long int, long long int>&&'}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
portals.cpp:209:46: error: no matching function for call to 'max(int, ll&)'
  209 |    adj[x].push_back({right[x]-1,max(0,dist[x])+1});
      |                                              ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
portals.cpp:209:46: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  209 |    adj[x].push_back({right[x]-1,max(0,dist[x])+1});
      |                                              ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from portals.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
portals.cpp:209:46: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
  209 |    adj[x].push_back({right[x]-1,max(0,dist[x])+1});
      |                                              ^
In file included from /usr/include/c++/10/algorithm:62