Submission #70345

# Submission time Handle Problem Language Result Execution time Memory
70345 2018-08-22T16:38:52 Z Angelos Game (IOI14_game) C++11
Compilation error
0 ms 0 KB
#include "grader.h"
#include "game.h"
#include <bits/stdc++.h>
#define MAXN 1010


int R[MAXN] , S[MAXN][MAXN] , sz[MAXN] , dis[MAXN] , N;

using namespace std;

void initialize(int n) {
    memset(dis , 0 , sizeof dis);
    N = n;
    for(int i=0; i<n; i++) R[i] = i , sz[i] = 1;


    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
            S[i][j] = (i != j) ? 1 : 0;


}

int fat(int x){
    if(R[x] == x) return x;
    R[x] = fat(R[x]);

    return R[x];
}

void unionn(int a , int b){
    int A = fat(a)  , B = fat(b);

    if(sz[B] > sz[A]) swap(A , B);

    if(sz[A] >= sz[B]) {
        for(int i=0; i<N; i++)
            if(i != A && i != B && !dis[i])  S[A][i] += S[B][i];


        sz[A] += sz[B];
        dis[B] = 1;
        R[B] = A;
    }
}

int hasEdge(int u, int v){
    int U = fat(u)  , V = fat(v);

    if(U == V || S[U][V] > 1) {
        S[U][V] --;
        return 0;
    }

    unionn(u , v);
    return 1;
}

Compilation message

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