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 <bits/stdc++.h>
#include "railroad.h"
template <class T>
using Vec = std::vector<T>;
using ll = long long;
constexpr int MAX = 1000000000;
ll plan_roller_coaster(Vec<int> s, Vec<int> t) {
s.push_back(MAX);
t.push_back(1);
std::map<int, int> count;
for (const auto x: s) {
count[x] -= 1;
}
for (const auto x: t) {
count[x] += 1;
}
int cur = 0;
for (const auto [x, c]: count) {
cur += c;
if (cur < 0) {
return 1;
}
}
return cur;
}
# | 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... |