| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 162626 | lukameladze | Game (IOI14_game) | C++14 | 2 ms | 376 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 <bits/stdc++.h>
using namespace std;
int a,b,d[100005],p[100005],mp[1005][1005],N;
void initialize(int n)
{
N=n;
for (int i=0; i<n; i++)
{
p[i]=i;
d[i]=1;
}
}
int get_col(int a)
{
if (p[a]==a) return p[a];
p[a]=get_col(p[a]);
return p[a];
}
void col(int a, int w)
{
p[get_col(a)]=get_col(w);
d[w]+=a;
d[a]=0;
p[a]=w;
}
int hasEdge(int u, int v)
{
a=get_col(a);
b=get_col(b);
mp[a][b]++;
mp[b][a]++;
if (mp[a][b]==d[a]*d[b])
{
if (d[a]>=d[b]) swap(a,b);
col(a,b);
cout<<"yes"<<endl;
}
else
cout<<"no"<<endl;
}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... | ||||
