Submission #994517

# Submission time Handle Problem Language Result Execution time Memory
994517 2024-06-07T18:35:39 Z SuPythony Roller Coaster Railroad (IOI16_railroad) C++17
0 / 100
55 ms 9536 KB
#include <bits/stdc++.h>
#include "railroad.h"
using namespace std;
typedef long long ll;

bool comp(pair<int,int> a, pair<int,int> b) {
    if (a.first==b.first) return a.second<b.second;
    return a.first>b.first;
}

ll plan_roller_coaster(vector<int> s, vector<int> t) {
    vector<pair<int,int>> a;
    for (int i=0; i<s.size(); i++) {
        a.push_back({s[i],t[i]});
    }
    sort(a.begin(),a.end(),comp);
    int curr=1;
    for (auto i: a) {
        if (curr>i.first) return 1;
        curr=i.second;
    }
    return 0;
};

Compilation message

railroad.cpp: In function 'll plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:13:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for (int i=0; i<s.size(); i++) {
      |                   ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 348 KB n = 2
6 Incorrect 0 ms 388 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 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 0 ms 348 KB n = 2
6 Incorrect 0 ms 388 KB answer is not correct: 1 instead of 523688153
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 9536 KB answer is not correct: 1 instead of 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 348 KB n = 2
6 Incorrect 0 ms 388 KB answer is not correct: 1 instead of 523688153
7 Halted 0 ms 0 KB -