# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
835309 | _martynas | Game (IOI14_game) | C++11 | 275 ms | 15820 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;
using namespace std::chrono;
const int mxn = 1505;
int n;
int par[mxn], sz[mxn];
int cons[mxn][mxn];
bool seen_set[mxn];
vector<int> sets;
int find_set(int a) {
int temp = par[a] == a ? a : par[a] = find_set(par[a]);
return temp;
}
int join_calls = 0;
int inner_loop = 0;
void join(int a, int b) {
join_calls++;
if(sz[b] > sz[a]) swap(a, b);
par[b] = a;
sz[a] += sz[b];
for(int i : sets) if(i != a) {
cons[a][i] += cons[b][i];
cons[i][a] += cons[i][b];
inner_loop++;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |