Submission #1069614

# Submission time Handle Problem Language Result Execution time Memory
1069614 2024-08-22T07:06:39 Z Ignut Roller Coaster Railroad (IOI16_railroad) C++17
0 / 100
119 ms 12888 KB
// 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 time Memory Grader output
1 Correct 0 ms 344 KB n = 2
2 Correct 0 ms 344 KB n = 2
3 Correct 0 ms 348 KB n = 2
4 Correct 0 ms 348 KB n = 2
5 Correct 1 ms 348 KB n = 2
6 Incorrect 0 ms 348 KB answer is not correct: 1 instead of 523688153
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB n = 2
2 Correct 0 ms 344 KB n = 2
3 Correct 0 ms 348 KB n = 2
4 Correct 0 ms 348 KB n = 2
5 Correct 1 ms 348 KB n = 2
6 Incorrect 0 ms 348 KB answer is not correct: 1 instead of 523688153
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 119 ms 12880 KB n = 199999
2 Correct 106 ms 12888 KB n = 199991
3 Correct 93 ms 12884 KB n = 199993
4 Correct 87 ms 9812 KB n = 152076
5 Correct 49 ms 6236 KB n = 93249
6 Correct 106 ms 12884 KB n = 199910
7 Correct 98 ms 12884 KB n = 199999
8 Correct 99 ms 12880 KB n = 199997
9 Correct 112 ms 11088 KB n = 171294
10 Incorrect 66 ms 9040 KB answer is not correct: 1 instead of 0
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB n = 2
2 Correct 0 ms 344 KB n = 2
3 Correct 0 ms 348 KB n = 2
4 Correct 0 ms 348 KB n = 2
5 Correct 1 ms 348 KB n = 2
6 Incorrect 0 ms 348 KB answer is not correct: 1 instead of 523688153
7 Halted 0 ms 0 KB -