# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1062892 | nvujica | Roller Coaster Railroad (IOI16_railroad) | C++14 | 61 ms | 11436 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>
#include "railroad.h"
#define fi first
#define se second
using namespace std;
const int inf = 1e9;
vector <pair<int, int> > v;
long long plan_roller_coaster(vector<int> s, vector<int> t) {
int n = s.size();
for(int i = 0; i < n; i++){
v.push_back({t[i], 1});
v.push_back({s[i], -1});
}
v.push_back({1, 1});
v.push_back({inf, -1});
sort(v.begin(), v.end());
int sum = 0;
for(int i = 0; i < v.size(); i++){
sum += v[i].se;
if(sum < 0) return 0;
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... |