Submission #155754

# Submission time Handle Problem Language Result Execution time Memory
155754 2019-09-30T09:12:16 Z brcode Portals (BOI14_portals) C++14
Compilation error
0 ms 0 KB
clude <iostream>
#include <queue>
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
int n,m;
char grid[MAXN][MAXN];
pair<int,int> start;
bool portal[MAXN][MAXN];
vector<pair<int,int>> portals;
queue<pair<int,int>> q1;
priority_queue<pair<int,pair<int,int>>> pq;
pair<int,int> finish;
int dx[5] = {1,0,-1,0};
int dy[5] = {0,1,0,-1};
int portall[MAXN][MAXN];
int portald[MAXN][MAXN];
int portalr[MAXN][MAXN];
int portalu[MAXN][MAXN];
int dp[MAXN][MAXN];
int dpl[MAXN][MAXN];
int dpr[MAXN][MAXN];
int dpu[MAXN][MAXN];
int dpd[MAXN][MAXN];
int dist[MAXN][MAXN];
bool check(int x,int y){
    if(x<=n && x>=1 && y<=m && y>=1){
        return true;
    }
    return false;
}
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>grid[i][j];
            if(grid[i][j] == 'S'){
                start = make_pair(i,j);
               // cout<<i<<" "<<j<<endl;
            }
            if(grid[i][j] == 'C'){
                finish = make_pair(i,j);
            }
        }
    }
    for(int i=1;i<=n;i++){
        grid[i][0] = '#';
        grid[i][m+1] = '#';
    }
    for(int i=1;i<=m;i++){
        grid[0][i] = '#';
        grid[n+1][i] = '#';
    }
 
    grid[0][0] = '#';
    grid[0][m+1] = '#';
    grid[n+1][0] = '#';
    grid[n+1][m+1] = '#';
    for(int i=0;i<=n+1;i++){
        for(int j=0;j<=m+1;j++){
            if(grid[i][j] == '#'){
                for(int k=0;k<4;k++){
                    int x2 = i+dx[k];
                    int y2 = j+dy[k];
 
                    if(check(x2,y2) && grid[x2][y2]!='#'){
                        //if within grid and surrounding cell is a movable cell, place a portal here
                        //int dx[5] = {1,0,-1,0};
                        //int dy[5] = {0,1,0,-1};
                        if(k==0){
                            portalu[x2][y2] = true;
                        }
                        if(k==1){
                            portall[x2][y2] = true;
                        }
                        if(k==2){
                            portald[x2][y2] = true;
                        }
                        if(k==3){
                            portalr[x2][y2] = true;
                        }
                        portal[x2][y2] = true;
                        portals.push_back(make_pair(x2,y2));
                    }
                }
            }
 
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            dist[i][j] = 1e9;
            dp[i][j] = 1e9;
        }
    }
    for(auto x:portals){
        q1.push(x);
 
       // cout<<x.first<<" "<<x.second<<endl;
        dist[x.first][x.second] = 0;
    }
    while(!q1.empty()){
        auto hold =q1.front();
        q1.pop();
        int x = hold.first;
        int y = hold.second;
        for(int i=0;i<4;i++){
            int x2 = x+dx[i];
            int y2 = y+dy[i];
            if(check(x2,y2) && dist[x2][y2]>dist[x][y]+1 && grid[x2][y2]!='#'){
 
                dist[x2][y2] = dist[x][y]+1;
                q1.push(make_pair(x2,y2));
            }
        }
    }
 
    for(int i=1;i<=n;i++){
        int hold = 1;
        for(int j=1;j<=m;j++){
            if(grid[i][j] == '#'){
                continue;
            }
            if(!portalr[i][j]){
                dpr[i][j] = hold;
            }else{
                hold = j;
            }
 
        }
    }
 
    for(int i=1;i<=n;i++){
        int hold = m;
        for(int j=m;j>=1;j--){
            if(grid[i][j] == '#'){
                continue;
            }
            if(!portall[i][j]){
                dpl[i][j] = hold;
            }else{
                hold = j;
            }
        }
    }
 
    for(int i=1;i<=m;i++){
        int hold = 1;
        for(int j=1;j<=n;j++){
            if(grid[j][i] == '#'){
                continue;
            }
            if(!portald[j][i]){
                dpd[j][i] = hold;
            }else{
                hold = j;
            }
        }
    }
 
    for(int i=1;i<=m;i++){
        int hold = n;
        for(int j=n;j>=1;j--){
            if(grid[j][i] == '#'){
                continue;
            }
            if(!portalu[j][i]){
                dpu[j][i] = hold;
            }else{
                hold = j;
            }
        }
    }
 
    pq.push(make_pair(0,start));
    dp[start.first][start.second] = 0;
    while(!pq.empty()){
        auto hold = pq.top();
        pq.pop();
        int w = hold.first;
 
        int x = hold.second.first;
        int y = hold.second.second;
 
        if(x == finish.first && y == finish.second){
            cout<<-1*w<<endl;
            return 0;
        }
        for(int i=0;i<4;i++){
            int x2 = x+dx[i];
            int y2 = y+dy[i];
            if(check(x2,y2) && grid[x2][y2]!='#' && dp[x2][y2]>dp[x][y]+1){
                dp[x2][y2] = dp[x][y]+1;
                pq.push(make_pair(-1*dp[x2][y2],make_pair(x2,y2)));
 
            }
            int p = dpl[x][y];
            if(check(x,p) && grid[x][p] != '#' && dp[x][p]>dp[x][y]+dist[x][y]+1){
                dp[x][p]=dp[x][y]+dist[x][y]+1;
                pq.push(make_pair(-1*dp[x][p],make_pair(x,p)));
 
            }
            p = dpr[x][y];
 
            if(check(x,p) && grid[x][p] != '#' && dp[x][p]>dp[x][y]+dist[x][y]+1){
                dp[x][p]=dp[x][y]+dist[x][y]+1;
                pq.push(make_pair(-1*dp[x][p],make_pair(x,p)));
 
            }
            p = dpu[x][y];
            if(x == 4 && y == 3){
                //cout<<123<<" "<<p<<endl;
                //cout<<dp[p][y]<<" "<<dp[x][y]+dist[x][y]+1<<endl;
            }
            if(check(p,y) && grid[p][y] != '#' && dp[p][y]>dp[x][y]+dist[x][y]+1){
                dp[p][y]=dp[x][y]+dist[x][y]+1;
                pq.push(make_pair(-1*dp[p][y],make_pair(p,y)));
 
            }
            p = dpd[x][y];
            if(check(p,y) && grid[p][y] != '#' && dp[p][y]>dp[x][y]+dist[x][y]+1){
                dp[p][y]=dp[x][y]+dist[x][y]+1;
                pq.push(make_pair(-1*dp[p][y],make_pair(p,y)));
 
            }
        }
    }
}

Compilation message

portals.cpp:1:1: error: 'clude' does not name a type
 clude <iostream>
 ^~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:62:0,
                 from /usr/include/c++/7/deque:60,
                 from /usr/include/c++/7/queue:60,
                 from portals.cpp:2:
/usr/include/c++/7/ext/type_traits.h:162:35: error: 'bool __gnu_cxx::__is_null_pointer' redeclared as different kind of symbol
   __is_null_pointer(std::nullptr_t)
                                   ^
/usr/include/c++/7/ext/type_traits.h:157:5: note: previous declaration 'template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)'
     __is_null_pointer(_Type)
     ^~~~~~~~~~~~~~~~~
/usr/include/c++/7/ext/type_traits.h:162:26: error: 'nullptr_t' is not a member of 'std'
   __is_null_pointer(std::nullptr_t)
                          ^~~~~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/deque:60,
                 from /usr/include/c++/7/queue:60,
                 from portals.cpp:2:
/usr/include/c++/7/type_traits:362:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/7/type_traits:363:25: error: '_Size' was not declared in this scope
     struct is_array<_Tp[_Size]>
                         ^~~~~
/usr/include/c++/7/type_traits:363:31: error: template argument 1 is invalid
     struct is_array<_Tp[_Size]>
                               ^
/usr/include/c++/7/type_traits:561:42: error: 'nullptr_t' is not a member of 'std'
     struct __is_null_pointer_helper<std::nullptr_t>
                                          ^~~~~~~~~
/usr/include/c++/7/type_traits:561:42: error: 'nullptr_t' is not a member of 'std'
/usr/include/c++/7/type_traits:561:51: error: template argument 1 is invalid
     struct __is_null_pointer_helper<std::nullptr_t>
                                                   ^
/usr/include/c++/7/type_traits:1464:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1464:37: error: 'size_t' is not a member of 'std'
/usr/include/c++/7/type_traits:1464:61: error: template argument 1 is invalid
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                                             ^
/usr/include/c++/7/type_traits:1464:61: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1469:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 0> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1469:37: error: 'size_t' is not a member of 'std'
/usr/include/c++/7/type_traits:1469:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/7/type_traits:1469:46: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1471:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/7/type_traits:1472:21: error: '_Size' was not declared in this scope
     struct rank<_Tp[_Size]>
                     ^~~~~
/usr/include/c++/7/type_traits:1472:27: error: template argument 1 is invalid
     struct rank<_Tp[_Size]>
                           ^
/usr/include/c++/7/type_traits:1473:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1473:37: error: 'size_t' is not a member of 'std'
/usr/include/c++/7/type_traits:1473:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/7/type_traits:1473:65: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1477:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1477:37: error: 'size_t' is not a member of 'std'
/usr/include/c++/7/type_traits:1477:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/7/type_traits:1477:65: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1482:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 0> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1482:37: error: 'size_t' is not a member of 'std'
/usr/include/c++/7/type_traits:1482:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/7/type_traits:1482:46: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1484:47: error: 'std::size_t' has not been declared
   template<typename _Tp, unsigned _Uint, std::size_t _Size>
                                               ^~~~~~
/usr/include/c++/7/type_traits:1485:23: error: '_Size' was not declared in this scope
     struct extent<_Tp[_Size], _Uint>
                       ^~~~~
/usr/include/c++/7/type_traits:1485:36: error: template argument 1 is invalid
     struct extent<_Tp[_Size], _Uint>
                                    ^
/usr/include/c++/7/type_traits:1486:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t,
                                     ^~~~~~
/usr/include/c++/7/type_traits:1486:37: error: 'size_t' is not a member of 'std'
/usr/include/c++/7/type_traits:1487:24: error: '_Size' was not declared in this scope
           _Uint == 0 ? _Size : extent<_Tp,
                        ^~~~~
/usr/include/c++/7/type_traits:1488:28: error: template argument 1 is invalid
           _Uint - 1>::value>
                            ^
/usr/include/c++/7/type_traits:1488:28: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1493:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t,
                                     ^~~~~~
/usr/include/c++/7/type_traits:1493:37: error: 'size_t' is not a member of 'std'
/usr/include/c++/7/type_traits:1495:31: error: template argument 1 is invalid
              _Uint - 1>::value>
                               ^
/usr/include/c++/7/type_traits:1495:31: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1944:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/7/type_traits:1945:30: error: '_Size' was not declared in this scope
     struct remove_extent<_Tp[_Size]>
                              ^~~~~
/usr/include/c++/7/type_traits:1945:36: error: template argument 1 is invalid
     struct remove_extent<_Tp[_Size]>
                                    ^
/usr/include/c++/7/type_traits:1957:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/7/type_traits:1958:35: error: '_Size' was not declared in this scope
     struct remove_all_extents<_Tp[_Size]>
                                   ^~~~~
/usr/include/c++/7/type_traits:1958:41: error: template argument 1 is invalid
     struct remove_all_extents<_Tp[_Size]>
                                         ^
/usr/include/c++/7/type_traits:2016:17: error: 'std::size_t' has not been declared
   template<std::size_t _Len>
                 ^~~~~~
/usr/include/c++/7/type_traits:2021:23: error: '_Len' was not declared in this scope
  unsigned char __data[_Len];
                       ^~~~
/usr/include/c++/7/type_traits:2036:17: error: 'std::size_t' has not been declared
   template<std::size_t _Len, std::size_t _Align =
                 ^~~~~~
/usr/include/c++/7/type_traits:2036:35: error: 'std::size_t' has not been declared
   template<std::size_t _Len, std::size_t _Align =
                                   ^~~~~~
/usr/include/c++/7/type_traits:2037:48: error: '_Len' was not declared in this scope
     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                ^~~~
/usr/include/c++/7/type_traits:2037:52: error: template argument 1 is invalid
     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                    ^
/usr/include/c++/7/type_traits:2042:23: error: '_Len' was not declared in this scope
  unsigned char __data[_Len];
                       ^~~~
/usr/include/c++/7/type_traits:2043:37: error: '_Align' was not declared in this scope
  struct __attribute__((__aligned__((_Align)))) { } __align;
                                     ^~~~~~
/usr/include/c++/7/type_traits:2050:20: error: 'size_t' does not name a type; did you mean '__size_t'?
       static const size_t _S_alignment = 0;
                    ^~~~~~
                    __size_t
/usr/include/c++/7/type_traits:2051:20: error: 'size_t' does not name a type; did you mean '__size_t'?
       static const size_t _S_size = 0;
                    ^~~~~~
                    __size_t
/usr/include/c++/7/type_traits:2057:20: error: 'size_t' does not name a type; did you mean '__size_t'?
       static const size_t _S_alignment =
                    ^~~~~~
                    __size_t
/usr/include/c++/7/type_traits:2060:20: error: 'size_t' does not name a type; did you mean '__size_t'?
       static const size_t _S_size =
                    ^~~~~~
                    __size_t
/usr/include/c++/7/type_traits:2075:13: error: 'size_t' has not been declared
   template <size_t _Len, typename... _Types>
             ^~~~~~
/usr/include/c++/7/type_traits:2082:20: error: 'size_t' does not name a type; did you mean '__size_t'?
       static const size_t _S_len = _Len > __strictest::_S_size
                    ^~~~~~
                    __size_t
/usr/include/c++/7/type_traits:2086:20: error: 'size_t' does not name a type; did you mean '__size_t'?
       static const size_t alignment_value = __strictest::_S_alignment;
                    ^~~~~~
                    __size_t
/usr/include/c++/7/type_traits:2088:40: error: '_S_len' was not declared in this scope
       typedef typename aligned_storage<_S_len, alignment_value>::type type;
                                        ^~~~~~
/usr/include/c++/7/type_traits:2088:48: error: 'alignment_value' was not declared in this scope
       typedef typename aligned_storage<_S_len, alignment_value>::type type;
                                                ^~~~~~~~~~~~~~~
/usr/include/c++/7/type_traits:2088:48: note: suggested alternative: 'alignment_of'
       typedef typename aligned_storage<_S_len, alignment_value>::type type;
                                                ^~~~~~~~~~~~~~~
                                                alignment_of
/usr/include/c++/7/type_traits:2088:63: error: template argument 1 is invalid
       typedef typename aligned_storage<_S_len, alignment_value>::type type;
                                                               ^
/usr/include/c++/7/type_traits:2088:63: error: template argument 2 is invalid
/usr/include/c++/7/type_traits:2091:13: error: 'size_t' has not been declared
   template <size_t _Len, typename... _Types>
             ^~~~~~
/usr/include/c++/7/type_traits:2092:11: error: 'size_t' does not name a type; did you mean '__size_t'?
     const size_t aligned_union<_Len, _Types...>::alignment_value;
           ^~~~~~
           __size_t
/usr/include/c++/7/type_traits:2463:12: error: 'size_t' has not been declared
   template<size_t _Len, size_t _Align =
            ^~~~~~
/usr/include/c++/7/type_traits:2463:25: error: 'size_t' has not been declared
   template<size_t _Len, size_t _Align =
                         ^~~~~~
/usr/include/c++/7/type_traits:2464:49: error: '_Len' was not declared in this scope
      __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                 ^~~~
/usr/include/c++/7/type_traits:2464:53: error: template argument 1 is invalid
      __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                     ^
/usr/include/c++/7/type_traits:2465:56: error: '_Len' was not declared in this scope
     using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
                                                        ^~~~
/usr/include/c++/7/type_traits:2465:62: error: '_Align' was not declared in this scope
     using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
                                                              ^~~~~~
/usr/include/c++/7/type_traits:2465:68: error: template argument 1 is invalid
     using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
                                                                    ^
/usr/include/c++/7/type_traits:2465:68: error: template argument 2 is invalid
/usr/include/c++/7/type_traits:2467:13: error: 'size_t' has not been declared
   template <size_t _Len, typename... _Types>
             ^~~~~~
/usr/include/c++/7/type_traits:2468:52: error: '_Len' was not declared in this scope
     using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
                                                    ^~~~
/usr/include/c++/7/type_traits:2468:67: error: template argument 1 is invalid
     using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
                                                                   ^
/usr/include/c++/7/type_traits:2581:26: error: 'size_t' has not been declared
   template<typename _Tp, size_t _Nm>
                          ^~~~~~
/usr/include/c++/7/type_traits:2584:21: error: '_Nm' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                     ^~~
/usr/include/c++/7/type_traits:2584:24: error: 'template<class _Tp, <declaration error> > typename std::enable_if<std::__is_swappable<_Tp>::value>::type std::swap' conflicts with a previous declaration
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                        ^
/usr/include/c++/7/type_traits:2577:5: note: previous declaration 'typename std::enable_if<std::__and_<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type std::swap(_Tp&, _Tp&)'
     swap(_Tp&, _Tp&)
     ^~~~
/usr/include/c++/7/type_traits:2584:16: error: '__a' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                ^~~
/usr/include/c++/7/type_traits:2584:16: note: suggested alternative: '__N'
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                ^~~
                __N
/usr/include/c++/7/type_traits:2584:21: error: '_Nm' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                     ^~~
/usr/include/c++/7/type_traits:2584:33: error: '__b' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                                 ^~~
/usr/include/c++/7/type_traits:2584:33: note: suggested alternative: '__N'
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                                 ^~~
                                 __N
/usr/include/c++/7/type_traits:2584:38: error: '_Nm' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                                      ^~~
/usr/include/c++/7/type_traits:2585:5: error: expected ';' before 'noexcept'
     noexcept(__is_nothrow_swappable<_Tp>::value);
     ^~~~~~~~
In file included from /usr/include/c++/7/bits/stl_pair.h:59:0,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/deque:60,
                 from /usr/include/c++/7/queue:60,
                 from portals.cpp:2:
/usr/include/c++/7/bits/move.h:206:26: error: 'size_t' has not been declared
   template<typename _Tp, size_t _Nm>
                          ^~~~~~
/usr/include/c++/7/bits/move.h:210:21: error: '_Nm' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                     ^~~
/usr/include/c++/7/bits/move.h:210:24: error: 'template<class _Tp, <declaration error> > typename std::enable_if<std::__is_swappable<_Tp>::value>::type std::swap' conflicts with a previous declaration
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                        ^
/usr/include/c++/7/bits/move.h:187:5: note: previous declaration 'typename std::enable_if<std::__and_<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type std::swap(_Tp&, _Tp&)'
     swap(_Tp& __a, _Tp& __b)
     ^~~~
/usr/include/c++/7/bits/move.h:210:16: error: '__a' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                ^~~
/usr/include/c++/7/bits/move.h:210:16: note: suggested alternative: '__N'
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                ^~~
                __N
/usr/include/c++/7/bits/move.h:210:21: error: '_Nm' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                     ^~~
/usr/include/c++/7/bits/move.h:210:33: error: '__b' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                                 ^~~
/usr/include/c++/7/bits/move.h:210:33: note: suggested alternative: '__N'
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                                 ^~~
                                 __N
/usr/include/c++/7/bits/move.h:210:38: error: '_Nm' was not declared in this scope
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                                      ^~~
/usr/include/c++/7/bits/move.h:211:5: error: expected ';' before 'noexcept'
     noexcept(__is_nothrow_swappable<_Tp>::value)
     ^~~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/7/deque:60,
                 from /usr/include/c++/7/queue:60,
                 from portals.cpp:2:
/usr/include/c++/7/bits/stl_pair.h:86:17: error: 'std::size_t' has not been declared
   template<std::size_t...>
                 ^~~~~~
/usr/include/c++/7/bits/stl_pair.h:429:41: error: 'std::size_t' has not been declared
       template<typename... _Args1, std::size_t... _Indexes1,
                                         ^~~~~~
/usr/include/c++/7/bits/stl_pair.h:430:41: error: 'std::size_t' has not been declared
                typename... _Args2, std::size_t... _Indexes2>
                                         ^~~~~~
/usr/include/c++/7/bits/stl_pair.h:432:27: error: '_Indexes1' was not declared in this scope
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                           ^~~~~~~~~
/usr/include/c++/7/bits/stl_pair.h:432:27: note: suggested alternative: '_Index_tuple'
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                           ^~~~~~~~~
                           _Index_tuple
/usr/include/c++/7/bits/stl_pair.h:432:36: error: expected parameter pack before '...'
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                    ^~~
/usr/include/c++/7/bits/stl_pair.h:432:39: error: template argument 1 is invalid
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                       ^
/usr/include/c++/7/bits/stl_pair.h:432:55: err