# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
519812 | ACE_ | Game (IOI14_game) | C++14 | 298 ms | 29524 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>
#define maxn 1505
using namespace std;
int p[maxn], c[maxn], sz;
vector<int> x[maxn];
void initialize(int n) {
for (int i = 0; i < n; i++) p[i] = i, c[i] = 0;
sz = 1;
}
int hasEdge(int u, int v) {
if (p[v] == 1) swap(u, v);
if (p[v] != 1 && p[u] != 1) {
x[u].push_back(v), x[v].push_back(u);
return 0;
}
if (c[v] == sz - 1) {
for (int j = 0; j < x[v].size(); j++) c[x[v][j]]++;
p[v] = 1;
sz++;
return 1;
}
c[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... |