# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
64796 | kjp4155 | 족보 (KOI18_family) | C++17 | 753 ms | 98900 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 <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int,int> Pi;
/* Union Find data structure */
int pa[300500], cnt[300500];
int find(int x){
if( pa[x] == x ) return x;
return pa[x] = find(pa[x]);
}
void uni(int a, int b){
a = find(a); b = find(b);
if( a == b ) return;
pa[a] = b;
cnt[b] += cnt[a];
}
struct event{
int t, len, level, node;
// Smaller event first. Deeper event first.
bool operator < (event e){
if( len != e.len ) return len < e.len;
return level > e.level;
}
};
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |