Submission #113966

# Submission time Handle Problem Language Result Execution time Memory
113966 2019-05-29T10:51:07 Z baqargam Game (IOI14_game) C++14
0 / 100
3 ms 512 KB
#include<bits/stdc++.h>
#include "game.h"

using namespace std;
int n,m,k,l,i,j,a,b,col[105],sz[105],d[105][105];

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;
}
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -