Submission #235602

#TimeUsernameProblemLanguageResultExecution timeMemory
235602mehrdad_sohrabiCop and Robber (BOI14_coprobber)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "coprobber.h" typedef long long int ll; typedef long double ld; #define pb push_back #define pii pair < ll , ll > #define F first #define S second #define endl '\n' #define int long long #define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math") #define kill(x) return cout<<x<<'\n', 0; using namespace std; const int N=MAX_N; ll win[N][N][2],deg[N],d[N][N],p[N][N]; queue <pair <pii,bool> > q; int start(ll n,bool A[N][N]){ for (int i=0;i<n;i++){ for (int j=0;j<n;j++){ deg[i]+=A[i][j]; } } for (int i=0;i<n;i++){ for (int j=0;j<n;j++){ d[i][j]=deg[j]; } } for (int i=0;i<n;i++){ win[0][i][i]=1; p[i][i]=i; q.push({{i,i},0}); q.push({{i,i},1}); win[1][i][i]=1; } while(q.size()){ ll c=q.front().F.F,r=q.front().F.S,b=q.front().S; q.pop(); if (b){ for (int i=0;i<n;i++){ if (A[r][i]){ d[c][i]--; if (d[c][r]==0 && win[c][i][0]){ win[0][c][i]=1; q.push({{c,i},0}); } } } } else{ for (int i=0;i<n;i++){ if (i==c || A[c][i]){ if (win[i][r][1]==0){ win[i][r][1]=1; par[i][r]=c; q.push({{i,r},1}); } } } } } for (int i=0;i<n;i++){ ll p1=0; for (int j=0;j<n;j++) if (win[i][j][1]==0) p1=1; if (!p1) return C=i; } return -1; } int nextMove(int R) { return C = p[C][R]; }

Compilation message (stderr)

coprobber.cpp: In function 'long long int start(ll, bool (*)[500])':
coprobber.cpp:57:25: error: 'par' was not declared in this scope
                         par[i][r]=c;
                         ^~~
coprobber.cpp:67:25: error: 'C' was not declared in this scope
         if (!p1) return C=i;
                         ^
coprobber.cpp: In function 'long long int nextMove(long long int)':
coprobber.cpp:72:12: error: 'C' was not declared in this scope
     return C = p[C][R];
            ^