# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1031677 | pcc | Roller Coaster Railroad (IOI16_railroad) | C++17 | 110 ms | 10688 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 pii pair<int,int>
#define fs first
#define sc second
#define pll pair<ll,ll>
#define _all(T) T.begin(),T.end()
const ll inf = 1e18;
const int mxn = 2e5+10;
int dif[mxn];
vector<int> all;
int suf[mxn*3];
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int N = (int)s.size();
all.push_back(0);
for(auto &i:s)all.push_back(i);
for(auto &i:t)all.push_back(i);
sort(_all(all));all.resize(unique(_all(all))-all.begin());
for(auto &i:s)i = lower_bound(_all(all),i)-all.begin();
for(auto &i:t)i = lower_bound(_all(all),i)-all.begin();
for(auto &i:s)suf[i]++;
for(auto &i:t)suf[i]--;
for(int i = all.size();i>=0;i--){
suf[i] += suf[i+1];
}
return (*min_element(suf,suf+all.size())<-1);
}
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... |