# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
117891 | nvmdava | Roller Coaster Railroad (IOI16_railroad) | C++17 | 1484 ms | 77388 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 N 200005
#define ff first
#define ss second
vector<pair<int, pair<int, int> > > f;
int p[N];
int find(int v){
return (v == p[v] ? v : p[v] = find(p[v]));
}
bool unite(int v, int u){
v = find(v);
u = find(u);
if(v == u) return 0;
p[v] = u;
return 1;
}
map<int, int> sw;
map<int, vector<int> > in;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int n = s.size();
s.push_back(1000000001);
t.push_back(1);
for(int i = 0; i <= n; i++){
sw[s[i]]++;
p[i] = 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... |