# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
749554 | onebit1024 | Game (IOI14_game) | C++17 | 1069 ms | 2856 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;
#define pb push_back
#define all(c) c.begin(), c.end()
#define endl "\n"
vector<vector<int>>dp,queried;
vector<int>id,sz;
int root(int x){
if(id[x]==x)return x;
return id[x] = root(id[x]);
}
void merge(int u, int v){
u = root(u);
v = root(v);
if(u==v)return;
if(sz[v] > sz[u])swap(v,u);
for(auto x : dp[v]){
dp[u].pb(x);
}
dp[v].clear();
id[v] = u;
sz[u]+=sz[v];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |