Submission #195646

#TimeUsernameProblemLanguageResultExecution timeMemory
195646MounirRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
253 ms16808 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; struct Arret { int borneMax, vitesseSortie; bool operator < (const Arret &autre) const { if (borneMax != autre.borneMax) return borneMax > autre.borneMax; return vitesseSortie > autre.vitesseSortie; } }; multiset<Arret> arrets; long long plan_roller_coaster(vector<int> s, vector<int> t){ int nArrets = s.size(); for (int iArret = 0; iArret < nArrets; ++iArret) arrets.insert({s[iArret], t[iArret]}); Arret arretCur = *arrets.begin(); arrets.erase(arrets.begin()); for (; !arrets.empty(); ){ Arret prochainArret = *arrets.lower_bound({arretCur.vitesseSortie, 0}); if (arrets.lower_bound({arretCur.vitesseSortie, 0}) == arrets.end()) return 0; arrets.erase(prochainArret); arretCur = prochainArret; } 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...