Submission #209930

#TimeUsernameProblemLanguageResultExecution timeMemory
209930anonymousRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
2077 ms15352 KiB
#include "railroad.h" #include <map> #include <utility> using namespace std; multimap<int,int> R; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int N = (int) s.size(); for (int i=0; i<N; i++) { R.insert({t[i], s[i]}); } R.insert({1, 1<<30}); while (R.size() > 1) { pair<int,int> cur = *R.rbegin(); R.erase(--R.end()); auto it = --R.end(); while (true) { if ((*it).second >= cur.first) { int newt = (*it).first; R.erase(it); R.insert({newt, cur.second}); break; } else if (it == R.begin()) {return(42069);} --it; } } return(0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...