Submission #561356

#TimeUsernameProblemLanguageResultExecution timeMemory
561356nekiRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
92 ms10388 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...