| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 263909 | daniel920712 | 게임 (IOI14_game) | C++14 | 1 ms | 384 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 <vector>
using namespace std;
int con=0,a,b,ok=0;
int Father[1505];
int sz[1505];
vector < pair < int , int > > all;
int Find(int here)
{
if(Father[here]==here) return here;
Father[here]=Find(Father[here]);
return Father[here];
}
void initialize(int n)
{
int i;
for(i=0;i<n;i++)
{
Father[i]=i;
sz[i]=1;
}
return ;
}
int hasEdge(int u, int v)
{
int con=0;
all.push_back(make_pair(u,v));
if(Find(u)==Find(v)) return 0;
for(auto i:all)
{
if(Find(i.first)==Find(u)&&Find(i.second)==Find(v)) con++;
if(Find(i.first)==Find(v)&&Find(i.second)==Find(u)) con++;
}
if(con==sz[Find(u)]*sz[Find(v)]-1)
{
sz[Find(u)]+=sz[Find(v)];
Father[Find(v)]=Find(u);
return 1;
}
}
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... | ||||
