# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
754874 | 2023-06-08T19:23:17 Z | alexander707070 | Roller Coaster Railroad (IOI16_railroad) | C++14 | 0 ms | 0 KB |
#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; }