Submission #226998

#TimeUsernameProblemLanguageResultExecution timeMemory
226998Charis02Game (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include "grader.h"
#define N 1505

int par[N],edges[N][N],nn;

int f(int x)
{
    if(par[x]==x)
        return x;

    return par[x]=f(par[x]);
}

bool issameset(int x,int y)
{
    int fx=f(x);
    int fy = f(y);

    return (fx==fy);
}

void join(int x,int y)
{
    int fx = f(x);
    int fy = f(y);

    par[fx] = fy;

    for(int i = 0;i < nn;i++)
    {
        edges[fy][i] += edges[fx][i];
        edges[fx][i] = 0;
    }

    return;
}

void initialize(int n)
{
    nn = n;
    for(int i = 0;i < n;i++)
    {
        for(int j = 0;j < n;j++)
        {
            if(i==j)
                continue;

            edges[i][j]=1;
        }

        par[i]=i;
    }

    return;
}

int hasEdge(int u, int v)
{
    if(issameset(u,v))
        return 0;

    int fu = f(u);
    int fv = f(v);

    edges[fu][fv]--;
    edges[fv][fu]--;

    if(edges[fu][fv] == 0)
    {
        join(fu,fv);
        return 1;
    }
    else
        return 0;
}

Compilation message (stderr)

game.cpp:1:10: fatal error: grader.h: No such file or directory
 #include "grader.h"
          ^~~~~~~~~~
compilation terminated.