# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
298886 | lakshith_ | Game (IOI14_game) | C++14 | 1050 ms | 2324 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 <bits/stdc++.h>
#include "game.h"
#define shit cout << "shit\n";
using namespace std;
struct subset{
int parent;
int rank;
};
subset subsets[1510];
int n;
int find(int x){
if(subsets[x].parent==-1)return x;
subsets[x].parent = find(subsets[x].parent);
return subsets[x].parent;
}
void Union(int X,int Y){
int x = find(X);
int y = find(Y);
if(subsets[x].rank<subsets[y].rank){
subsets[x].parent = y;
}else if(subsets[x].rank>subsets[y].rank){
subsets[y].parent = x;
}else{
subsets[x].parent = y;
subsets[y].rank++;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |