# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1042942 | ReLice | Roller Coaster Railroad (IOI16_railroad) | C++17 | 2085 ms | 110232 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 "railroad.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define vll vector<ll>
#define fr first
#define bc back()
#define sc second
const ll inf=1e9+10;
const ll N=5e5+7;
vector<vll> g(N);
ll p[N],siz[N];
ll anc(ll a){
return (a==p[a] ? a : p[a]=anc(p[a]));
}
bool uni(ll a,ll b){
a=anc(a),b=anc(b);
if(a==b)return false;
if(siz[a]>siz[b])swap(a,b);
siz[b]+=siz[a];
p[a]=b;
return true;
}
long long plan_roller_coaster(vector<int> s, vector<int> t) {
ll i;
ll n=s.size();
//compress;
set<int> st;
# | 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... |