This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |