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 "railroad.h"
#include<bits/stdc++.h>
using namespace std;
vector<int>allind;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int n = (int) s.size();
vector<pair<int,int>>v;
v.push_back(make_pair(0,1));
for(int i=0;i<n;i++){
v.push_back(make_pair(t[i],s[i]));
}
sort(v.begin(),v.end());
vector<int>ps(n+1);
for(int i=1;i<=n;i++){
int p=lower_bound(v.begin(),v.end(),make_pair(v[i].second+1,-1))-v.begin();
p--;
ps[p]++;
}
for(int i=1;i<=n;i++){
ps[i]+=ps[i-1];
}
for(int i=0;i<=n;i++){
if(ps[i]>i+1);
}
return 0;
}
# | 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... |