# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1006597 | Mardonbekhazratov | Game (IOI14_game) | C++17 | 0 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include<bits/stdc++.h>
using namespace std;
int n;
vector<int>p,c;
vector<bool>vis;
int find(int x){
if(x==p[x]) return x;
return p[x]=find(p[x]);
}
bool unite(int x,int y){
x=find(x);
y=find(y);
if(x==y) return 1;
}
void initialize(int N) {
n=N;
p.resize(n);
iota(p.begin(),p.end(),0);
c.assign(n,0);
vis.assign(n,0);
}
int hasEdge(int u, int v) {
c[u]++;
c[v]++;
if((c[u]==n-1&&!vis[u]) || (c[v]==n-1 && !vis[v])){
vis[u]=true;
vis[v]=true;
return 1;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |