# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1042359 | baldwinhuang1 | Roller Coaster Railroad (IOI16_railroad) | C++14 | 31 ms | 14140 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 <bits/stdc++.h>
using namespace std;
long long plan_roller_coaster(vector<int> s, vector<int> t) {
vector< pair<int, int> > st;
for (int i = 0; i < s.size(); i++) {
st.push_back({s[i], t[i]});
// cout << s[i] << '-' << t[i] << '\n';
}
sort(st.begin(), st.end(), [](pair<int, int> i, pair<int, int> j){return i.second <= j.first;});
bool state = true;
for (int i = 0; i < (st.size() - 1); i++) {
if (st[i].second > st[i + 1].first) {
state = false;
}
}
// for (auto &i: st) {
// cout << i.first << '-' << i.second << ' ';
// }
// cout << '\n';
return state;
}
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... |