# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
159311 | TAISA_ | Game (IOI14_game) | C++14 | 517 ms | 16540 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 co[1500][1500];
struct UF {
vector<vector<int>> vs;
vector<int> par;
int n;
void build(int n_) {
n = n_;
vs.resize(n);
par.resize(n);
for (int i = 0; i < n; i++) {
vs[i].push_back(i);
par[i] = i;
}
}
bool unite(int u, int v) {
if (par[u] == par[v]) {
return false;
}
int tu = u, tv = v;
u = par[tu];
v = par[tv];
int su = vs[u].size(), sv = vs[v].size();
if (su < sv) {
swap(u, v);
swap(su, sv);
swap(tu, tv);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |