# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
73157 | Kmcode | Roller Coaster Railroad (IOI16_railroad) | C++14 | 614 ms | 30848 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;
//#include "railroad.h"
map<int,long long int> mp;
#define MAX 500002
int belong[MAX];
inline int root(int b){
if(belong[b]==-1){
return b;
}
return belong[b]=root(belong[b]);
}
void merge(int a,int b){
a=root(a);
b=root(b);
if(a==b)return;
belong[a]=b;
return;
}
map<int,int> idx;
set<int> ss;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
memset(belong,-1,sizeof(belong));
t.push_back(-1);
s.push_back(INT_MAX-3);
for(int i=0;i<s.size();i++){
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... |