Submission #994852

# Submission time Handle Problem Language Result Execution time Memory
994852 2024-06-08T07:38:36 Z SuPythony Roller Coaster Railroad (IOI16_railroad) C++17
0 / 100
105 ms 16724 KB
#include <bits/stdc++.h>
#include "railroad.h"
using namespace std;
typedef long long ll;

ll plan_roller_coaster(vector<int> s, vector<int> t) {
    int curr=1;
    multiset<pair<int,int>> a;
    for (int i=0; i<s.size(); i++) {
        a.insert({s[i],t[i]});
    }
    while (!a.empty()) {
        auto it=a.lower_bound({curr,0});
        if (it==a.end()) return 1;
        curr=(*it).second;
        a.erase(it);
    }
    return 0;
};

Compilation message

railroad.cpp: In function 'll plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:9:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i=0; i<s.size(); i++) {
      |                   ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB n = 2
2 Correct 0 ms 348 KB n = 2
3 Correct 0 ms 348 KB n = 2
4 Correct 0 ms 348 KB n = 2
5 Correct 1 ms 344 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 1 ms 348 KB n = 2
2 Correct 0 ms 348 KB n = 2
3 Correct 0 ms 348 KB n = 2
4 Correct 0 ms 348 KB n = 2
5 Correct 1 ms 344 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 95 ms 16724 KB n = 199999
2 Correct 105 ms 16724 KB n = 199991
3 Correct 98 ms 16696 KB n = 199993
4 Correct 82 ms 12364 KB n = 152076
5 Correct 51 ms 8020 KB n = 93249
6 Correct 100 ms 15444 KB n = 199910
7 Correct 94 ms 15956 KB n = 199999
8 Correct 96 ms 15652 KB n = 199997
9 Correct 100 ms 14164 KB n = 171294
10 Incorrect 74 ms 11864 KB answer is not correct: 1 instead of 0
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB n = 2
2 Correct 0 ms 348 KB n = 2
3 Correct 0 ms 348 KB n = 2
4 Correct 0 ms 348 KB n = 2
5 Correct 1 ms 344 KB n = 2
6 Incorrect 0 ms 348 KB answer is not correct: 1 instead of 523688153
7 Halted 0 ms 0 KB -