# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29807 | nibnalin | Game (IOI14_game) | C++14 | 593 ms | 19672 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 <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include "game.h"
using namespace std;
const int maxn = 1505;
int n, P[maxn], sz[maxn], ctr[maxn][maxn];
inline int root(int x)
{
return ((P[x] == x)?x:(P[x] = root(P[x])));
}
void dsu(int x, int y)
{
x = root(x), y = root(y);
if(sz[x] < sz[y]) swap(x, y);
P[y] = x;
sz[x] += sz[y];
for(int i = 0;i < n;i++)
{
int a = min(i, x), b = max(i, x);
ctr[a][b] = ctr[min(i, x)][max(i, x)]+ctr[min(i, y)][max(i, y)];
}
}
void initialize(int _N)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |