# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
754874 | alexander707070 | Roller Coaster Railroad (IOI16_railroad) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n;
pair<int,int> a[200007];
bool cmp(pair<int,int> fr,pair<int,int> sc){
return max(fr.second-sc.first,0) < max(sc.second-fr.first,0);
}
long long plan_roller_coaster(int N,vector<int> s,vector<int> t){
n=N;
for(int i=1;i<=n;i++){
a[i]={s[i-1],t[i-1]};
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n-1;i++){
if(a[i].second>a[i+1].first)return 1;
}
return 0;
}