# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
645534 | TimDee | Speedrun (RMI21_speedrun) | C++17 | 441 ms | 8768 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 "speedrun.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> p(1e3+1);
vector<int> r(1e3+1,0);
int get(int a) {
return (a==p[a])?a:get(a);
}
void uni(int a, int b) {
a=get(a), b=get(b);
if (a==b) return;
if (r[a]==r[b]) ++r[a];
if (r[a]<r[b]) swap(a,b);
p[b]=a;
}
void assignHints(int id,int n, int a[], int b[]) {
if (id==1) {
setHintLen(n);
for(int i=1;i<=n-1;++i) {
int u=a[i],v=b[i];
setHint(u,v,1);
setHint(v,u,1);
}
}
if (id==2) {
setHintLen(20);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |