답안 #789873

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
789873 2023-07-22T06:40:10 Z Minindu206 Roller Coaster Railroad (IOI16_railroad) C++14
0 / 100
75 ms 9916 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)
    {
        if(ss[i].second != tt[j].second)
        {
            if(tt[j].first > ss[i].first)
                return 999;
        }
        else
        {
            if(tt[j].first > ss[i + 1].first)
                return 999;
        }
        i++, j++;
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB answer is not correct: 999 instead of 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB answer is not correct: 999 instead of 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 68 ms 9916 KB n = 199999
2 Correct 66 ms 9888 KB n = 199991
3 Correct 75 ms 9888 KB n = 199993
4 Correct 54 ms 9016 KB n = 152076
5 Correct 31 ms 4992 KB n = 93249
6 Incorrect 61 ms 9904 KB answer is not correct: 1 instead of 0
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB answer is not correct: 999 instead of 0
2 Halted 0 ms 0 KB -