Submission #138407

#TimeUsernameProblemLanguageResultExecution timeMemory
138407arthurconmyRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
152 ms10728 KiB
#include <bits/stdc++.h> #ifndef ARTHUR_LOCAL #include "railroad.h" #endif using namespace std; using ll=long long; const int MAXN = 200000; ll plan_roller_coaster(vector<int> s, vector<int> t) { int n = s.size(); vector<pair<int,int>> ST; for(int i=0; i<n; i++) { ST.push_back({s[i],t[i]}); } sort(ST.begin(),ST.end()); vector<int> vals; for(int i=0; i<n; i++) { int k = lower_bound(ST.begin(),ST.end(),make_pair(ST[i].second,0)) - ST.begin(); // if(TS[0].first > TS[i].second) vals.push_back(-1); vals.push_back(k); } sort(vals.begin(),vals.end()); int offences=0; for(int i=0; i<n; i++) { // cout << i << " " << vals[i] << endl; if(vals[i] > i) offences++; } if(offences>1) return 1; return 0; } #ifdef ARTHUR_LOCAL int main() { plan_roller_coaster({10,10,10},{2,1,3}); } #endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...