# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
835269 | unnick | Game (IOI14_game) | C++14 | 1 ms | 464 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 <iostream>
#include <vector>
#include <numeric>
using namespace std;
vector<int> free_e;
vector<short> free_c;
vector<char> edges;
int n;
void initialize(int n_) {
n = n_;
free_c.resize(n,n-1);
free_e.resize(n,(n)*(n-1)/2);
for (int i = 0; i < n; i++) free_e[i] -= i;
edges.resize(n*n, 0);
}
void dc(int x, int y) {
while (true) {
free_e[x] -= y;
if (--free_c[x] != 1) return;
y = x;
x = free_e[x];
edges[max(x,y)+min(x,y)*n] = 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |