This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Ignut
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18 + 123;
ll plan_roller_coaster(vector<int> s, vector<int> t) {
int n = s.size();
multiset<pair<int, int>> ms;
for (int i = 0; i < n; i ++) ms.insert({s[i], -t[i]});
int speed = 1;
for (int i = 0; i < n; i ++) {
auto it = ms.lower_bound({speed, -1'000'000'001});
if (it == ms.end())
return 1;
auto [S, T] = *it;
ms.erase(it);
speed = -T;
}
return 0ll;
}
# | 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... |