답안 #789896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
789896 2023-07-22T06:54:39 Z Minindu206 Roller Coaster Railroad (IOI16_railroad) C++14
0 / 100
67 ms 9908 KB
#include "railroad.h"
#include <bits/stdc++.h>
using namespace std;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t)
{
    #define int long long
    int n = (int)s.size();
    vector<pair<int, int>> ss, tt;
    for(int i=0;i<n;i++)
    {
        tt.push_back({t[i], i});
        ss.push_back({s[i], i});
    }
    sort(ss.rbegin(), ss.rend());
    sort(tt.rbegin(), tt.rend());
 
    int i = 0, j = 0;
    while(i < n - 1)
    {
        if(ss[i].second != tt[j].second)
        {
            if(tt[j].first > ss[i].first)
                return 999;
        }
        else if(i != 0)
        {
            if(tt[j].first > ss[i - 1].first)
                return 999;
        }
        i++, j++;
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 2
2 Correct 0 ms 212 KB n = 2
3 Correct 0 ms 212 KB n = 2
4 Correct 0 ms 212 KB n = 2
5 Correct 0 ms 212 KB n = 2
6 Incorrect 0 ms 212 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 2
2 Correct 0 ms 212 KB n = 2
3 Correct 0 ms 212 KB n = 2
4 Correct 0 ms 212 KB n = 2
5 Correct 0 ms 212 KB n = 2
6 Incorrect 0 ms 212 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 65 ms 9908 KB n = 199999
2 Correct 67 ms 9896 KB n = 199991
3 Correct 65 ms 9828 KB n = 199993
4 Correct 56 ms 9020 KB n = 152076
5 Correct 29 ms 4992 KB n = 93249
6 Correct 60 ms 9900 KB n = 199910
7 Correct 61 ms 9896 KB n = 199999
8 Correct 61 ms 9860 KB n = 199997
9 Correct 56 ms 9304 KB n = 171294
10 Incorrect 45 ms 8808 KB answer is not correct: 1 instead of 0
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 2
2 Correct 0 ms 212 KB n = 2
3 Correct 0 ms 212 KB n = 2
4 Correct 0 ms 212 KB n = 2
5 Correct 0 ms 212 KB n = 2
6 Incorrect 0 ms 212 KB answer is not correct: 0 instead of 523688153
7 Halted 0 ms 0 KB -