#include <bits/stdc++.h>
// #include "grader.cpp"
using namespace std;
typedef long long ll;
ll plan_roller_coaster (vector<int> s, vector<int> t){
int n = s.size();
set<pair<int, pair<int, int>>> st;
for (int i=0; i<n; i++)
st.insert({t[i], {s[i], i}});
pair<int, pair<int, int>> last = {-1, {1, -1}};
ll can = 1;
while (st.size()){
auto lb = st.lower_bound(last);
if (lb == st.end()){
can = 0;
break;
}
last = *lb;
last.second.first = last.first;
last.first = -1;
last.second.second = -1;
st.erase(lb);
}
return can;
}
// int main(){
// return 0;
// }
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
101 ms |
16076 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |