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>
#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define all(s) s.begin(), s.end()
using namespace std;
const int N = 2e5 + 5;
int n;
multiset < pair <int, int>, greater <pair< int, int> > > s;
long long plan_roller_coaster(vector <int> a, vector<int> b) {
n = a.size();
for (int i = 0; i < n; i++) {
s.insert({b[i], a[i]});
}
int v = 1e9 + 7;
while (!s.empty()) {
auto it = s.upper_bound({v, 1e9});
if (it == s.begin())
return 1;
it--;
v = it->sc;
s.erase(it);
}
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... |