Submission #92184

#TimeUsernameProblemLanguageResultExecution timeMemory
92184CPXGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
void initialize(int n) { ::n=n; for(int i = 0 ; i<= n ; i++)vis[i][i]=1; } int hasEdge(int u, int v) { if(vis[u][v])return val[u][v]; vis[u][v]=vis[v][u]=1; ctr[u]++; ctr[v]++; if(ctr[u]>n-2||ctr[v]>n-2){ val[u][v]=val[v][u]=1; return 1; }else{ val[u][v]=val[v][u]=0; return 0; } }

Compilation message (stderr)

game.cpp: In function 'void initialize(int)':
game.cpp:2:7: error: '::n' has not been declared
     ::n=n;
       ^
game.cpp:3:33: error: 'vis' was not declared in this scope
     for(int i = 0 ; i<= n ; i++)vis[i][i]=1;
                                 ^~~
game.cpp:3:33: note: suggested alternative: 'void'
     for(int i = 0 ; i<= n ; i++)vis[i][i]=1;
                                 ^~~
                                 void
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:7:8: error: 'vis' was not declared in this scope
     if(vis[u][v])return val[u][v];
        ^~~
game.cpp:7:8: note: suggested alternative: 'void'
     if(vis[u][v])return val[u][v];
        ^~~
        void
game.cpp:7:25: error: 'val' was not declared in this scope
     if(vis[u][v])return val[u][v];
                         ^~~
game.cpp:8:5: error: 'vis' was not declared in this scope
     vis[u][v]=vis[v][u]=1;
     ^~~
game.cpp:8:5: note: suggested alternative: 'void'
     vis[u][v]=vis[v][u]=1;
     ^~~
     void
game.cpp:9:5: error: 'ctr' was not declared in this scope
     ctr[u]++;
     ^~~
game.cpp:9:5: note: suggested alternative: 'char'
     ctr[u]++;
     ^~~
     char
game.cpp:11:15: error: 'n' was not declared in this scope
     if(ctr[u]>n-2||ctr[v]>n-2){
               ^
game.cpp:12:9: error: 'val' was not declared in this scope
         val[u][v]=val[v][u]=1;
         ^~~
game.cpp:15:9: error: 'val' was not declared in this scope
         val[u][v]=val[v][u]=0;
         ^~~