# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23187 | gs14004 | Logistical Metropolis (KRIII5_LM) | C++11 | 1349 ms | 45272 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>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;
const int MAXN = 100005;
struct disj{
int pa[MAXN], sz[MAXN];
void init(int n){
for(int i=0; i<=n; i++){
pa[i] = i;
sz[i] = 1;
}
}
int find(int x){
return pa[x] = (pa[x] == x ? x : find(pa[x]));
}
bool uni(int p, int q){
p = find(p);
q = find(q);
if(p == q) return 0;
pa[q] = p;
sz[p] += sz[q];
return 1;
}
}disj;
struct edg{
int s, e, x;
bool operator<(const edg &e)const{
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |