# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
30423 | kavun | Game (IOI14_game) | C++14 | 0 ms | 10872 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 cc[2000], cccnt[2000], N, cnt;
vector <int> ccver[2000];
void initialize(int n) {
N = n;
}
int hasEdge(int u, int v) {
if(cc[u] == cc[v])
return 1;
if(cccnt[u] == N-1)
{
for(int i = 0; i < ccver[cc[u]].size(); i++)
ccver[cc[v]].push_back(ccver[cc[u]][i]), cc[ccver[cc[u]][i]] = cc[v];
return 1;
}
if(cccnt[v] == N-1)
{
for(int i = 0; i < ccver[cc[v]].size(); i++)
ccver[cc[u]].push_back(ccver[cc[v]][i]), cc[ccver[cc[v]][i]] = cc[u];
return 1;
}
else
{
cccnt[u]++;
cccnt[v]++;
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... |