Submission #807562

#TimeUsernameProblemLanguageResultExecution timeMemory
807562firewaterRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
139 ms15168 KiB
#include "railroad.h" #include<set> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define fs first #define sn second #define mp make_pair #define ll long long #define N 202300 using namespace std; int n,x,now; set<pair<int,int> >st; set<pair<int,int> >::iterator it; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { n = s.size(); x=0; for(int i=1;i<n;++i) if(t[i]>t[x])x=i; for(int i=0;i<n;++i) if(x!=i) st.insert(mp(s[i],i)); now=1; for(int i=0;i<n-1;++i){ it=st.lower_bound(mp(now,0)); if(it==st.end())return 1; now=t[(*it).sn]; st.erase(it); } if(now<=s[x])return 0; else return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...