Submission #135397

#TimeUsernameProblemLanguageResultExecution timeMemory
135397antimirageRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
214 ms16700 KiB
#include "railroad.h" #include <bits/stdc++.h> #define fr first #define sc second #define mk make_pair #define pb push_back #define all(s) s.begin(), s.end() using namespace std; const int N = 2e5 + 5; int n; multiset < pair <int, int>, greater <pair< int, int> > > s; long long plan_roller_coaster(vector <int> a, vector<int> b) { n = a.size(); for (int i = 0; i < n; i++) { s.insert({b[i], a[i]}); } int v = 1e9 + 7; while (!s.empty()) { auto it = s.upper_bound({v, 1e9}); if (it == s.begin()) return 1; it--; v = it->sc; s.erase(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...