# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1192300 | Mousa_Aboubaker | Roller Coaster Railroad (IOI16_railroad) | C++20 | 47 ms | 4288 KiB |
#include "railroad.h"
#include <bits/stdc++.h>
using namespace std;
long long plan_roller_coaster(vector<int> s, vector<int> t) {
int n = s.size();
// each s_i must have a t_i less than or equal to it
vector<int> ord(n);
iota(ord.begin(), ord.end(), 0);
sort(ord.begin(), ord.end(), [&](int l, int r){
return s[l] < s[r];
});
bool can = true;
for(int i = 0; i + 1 < n; i++)
{
int j = ord[i], k = ord[i + 1];
can &= t[j] <= s[k];
}
if(not can)
return 1;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |