| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 72613 | vex | Game (IOI14_game) | C++14 | 3 ms | 432 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define maxn 1505
using namespace std;
int n;
int sz[maxn],p[maxn],br[maxn][maxn];
void initialize(int N)
{
n=N;
for(int i=0;i<n;i++)
{
sz[i]=1;
p[i]=i;
}
for(int i=0;i<n;i++)for(int j=0;j<n;j++)br[i][j]=0;
}
int fnd(int x)
{
if(x==p[x])return x;
return p[x]=fnd(p[x]);
}
int hasEdge(int u,int v)
{
u=fnd(u);
v=fnd(v);
if(u==v)return 1;
if(sz[u]<sz[v])swap(u,v);
if(br[u][v]+1==sz[u]*sz[v])
{
sz[u]+=sz[v];
p[v]=p[u];
for(int i=0;i<n-1;i++)
{
if(i==u)continue;
br[u][i]+=br[v][i];
br[i][u]+=br[v][i];
}
return 1;
}
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
