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>
#define vc vector
#define ll long long
using namespace std;
ll plan_roller_coaster(vc<int> s, vc<int> t) {
s.push_back(1000000100);t.push_back(1);
ll n=s.size();
vc<ll> ind(n); iota(ind.begin(), ind.end(), 0);
sort(ind.begin(), ind.end(), [&](ll a, ll b){return s[a]<s[b];});
vc<ll> kok(n, 0);
sort(t.begin(), t.end());
for(ll i=0, j=0;i<n;++i){
while(j<n and t[i]>s[ind[j]]) j++;
if(j<n) ++kok[j];
}
for(ll i=1;i<n;++i) kok[i]+=kok[i-1];
ll br=1;
for(ll i=0;i<n;++i) if(kok[i]>=i+1) br=0;
return br;
}
# | 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... |