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;
ll plan_roller_coaster(vector<int> S, vector<int> E) {
const int N=S.size();
vector<int> X(N);
iota(X.begin(), X.end(), 0);
sort(X.begin(), X.end(), [&](int i, int j) { return S[i]<S[j]; });
int s=1e9, e=1e9;
for(int i:X) {
if(E[i]<=s) e=min(e, E[i]);
else if(S[i]<e) return 1;
s=S[i];
}
return 0;
}
# | 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... |