# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
73141 | Kmcode | Roller Coaster Railroad (IOI16_railroad) | C++14 | 568 ms | 28580 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;
//#include "railroad.h"
map<int,long long int> mp;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
t.push_back(-1);
s.push_back(INT_MAX-3);
for(int i=0;i<s.size();i++){
mp[s[i]]++;
mp[t[i]]--;
}
long long int sum=0;
for(auto it:mp){
long long int add=sum;
sum-=it.second;
it.second+=add;
it.second-=sum;
if(it.second<0){
return 1;
}
}
for(auto it:mp){
if(it.second&1){
return 1;
}
}
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... |