# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
610526 | alirezasamimi100 | Roller Coaster Railroad (IOI16_railroad) | C++17 | 278 ms | 25100 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;
using ll = long long int;
using pll = pair<ll,ll>;
#define pb push_back
#define F first
#define S second
vector<ll> cp,ps,p;
vector<pll> vec;
int n;
ll ans;
ll gp(ll x){
return p[x]==-1?x:p[x]=gp(p[x]);
}
bool uni(ll v, ll u){
v=gp(v);
u=gp(u);
if(v==u) return false;
p[u]=v;
return true;
}
ll plan_roller_coaster(vector<int> s, vector<int> t) {
s.pb(1e9+10);
t.pb(1);
for(int i=0; i<(int)s.size(); i++){
# | 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... |