Submission #1069614

#TimeUsernameProblemLanguageResultExecution timeMemory
1069614IgnutRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
119 ms12888 KiB
// Ignut #include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1e18 + 123; ll plan_roller_coaster(vector<int> s, vector<int> t) { int n = s.size(); multiset<pair<int, int>> ms; for (int i = 0; i < n; i ++) ms.insert({s[i], -t[i]}); int speed = 1; for (int i = 0; i < n; i ++) { auto it = ms.lower_bound({speed, -1'000'000'001}); if (it == ms.end()) return 1; auto [S, T] = *it; ms.erase(it); speed = -T; } return 0ll; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...