제출 #291503

#제출 시각아이디문제언어결과실행 시간메모리
291503shayan_pRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
109 ms7300 KiB
// Oh damn! Suddenly you're free to fly... #include<bits/stdc++.h> #include "railroad.h" #define F first #define S second #define PB push_back #define sz(s) int((s).size()) #define bit(n,k) (((n)>>(k))&1) using namespace std; typedef long long ll; typedef pair<int,int> pii; const int maxn = 2e5 + 10, mod = 1e9 + 7, inf = 1e9 + 10; ll plan_roller_coaster(vector<int> a, vector<int> b){ swap(a, b); int n = sz(a); sort(a.begin(), a.end()); sort(b.begin(), b.end()); int pt = n-1; for(int i = n-1; i >= 0; i--){ while(pt >= 0 && b[i] <= a[pt]) pt--; if(pt > i) return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...