Submission #113964

#TimeUsernameProblemLanguageResultExecution timeMemory
113964baqargamGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "game.h"

using namespace std;
int n,m,k,l,i,j,a,b;

void initialize(int n) {
    for(int i=0;i<n*(n-1)/2;i++)
    {
        cin>>a>>b;
        cout<<hasEdge(a,b);

    }
}

void unite(int a,int b){
    sz[a]+=sz[b];
    for(int i=0;i<n;i++){
        if(col[i]==b) col[i]=a;
        d[a][i]+=d[b][i];
    }
}

int hasEdge(int u, int v) {
    if(d[col[a]][col[b]]+1==sz[a]*sz[b])
    {
        unite(col[a],col[b]);
        return 1;
    }
    else
        return 0;
}

Compilation message (stderr)

game.cpp: In function 'void unite(int, int)':
game.cpp:17:5: error: 'sz' was not declared in this scope
     sz[a]+=sz[b];
     ^~
game.cpp:19:12: error: 'col' was not declared in this scope
         if(col[i]==b) col[i]=a;
            ^~~
game.cpp:19:12: note: suggested alternative: 'cosl'
         if(col[i]==b) col[i]=a;
            ^~~
            cosl
game.cpp:20:9: error: 'd' was not declared in this scope
         d[a][i]+=d[b][i];
         ^
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:25:8: error: 'd' was not declared in this scope
     if(d[col[a]][col[b]]+1==sz[a]*sz[b])
        ^
game.cpp:25:10: error: 'col' was not declared in this scope
     if(d[col[a]][col[b]]+1==sz[a]*sz[b])
          ^~~
game.cpp:25:10: note: suggested alternative: 'cosl'
     if(d[col[a]][col[b]]+1==sz[a]*sz[b])
          ^~~
          cosl
game.cpp:25:29: error: 'sz' was not declared in this scope
     if(d[col[a]][col[b]]+1==sz[a]*sz[b])
                             ^~
game.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^