Submission #648056

#TimeUsernameProblemLanguageResultExecution timeMemory
648056PoonYaPatGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include "game.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;

int n,p[1501],d[1501][1501];

int find(int x) {
    while (x!=p[x]) x=p[x];
    return x;
}

void initialize(int N) {
    n=N;
    for (int i=0; i<n; ++i) {
        p[i]=i;
        for (int j=0; j<n; ++j) d[i][j]=d[j][i]=1;
    }
}

int hasEdge(int u, int v) {
    u=find(u); v=find(v);
    if (u==v) return 1;
    if (d[u][v]==1) {
        p[v]=u;
        for (int i=0; i<n; ++i) {
            if (p[i]==i && i!=u) { //go to another component
                d[u][i]=d[i][u]=d[u][i]+d[v][i];
            }
        }
        return 1;
    } else {
        --d[u][v];
        --d[v][u];
        return 0;
    }
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccyGkzxD.o: in function `read_int()':
grader.cpp:(.text+0x0): multiple definition of `read_int()'; /tmp/cc4TGhqG.o:game.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccyGkzxD.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc4TGhqG.o:game.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccyGkzxD.o:(.bss+0x0): multiple definition of `rets'; /tmp/cc4TGhqG.o:(.bss+0x899ac0): first defined here
collect2: error: ld returned 1 exit status