Submission #264756

#TimeUsernameProblemLanguageResultExecution timeMemory
264756sealnot123Roller Coaster Railroad (IOI16_railroad)C++14
0 / 100
133 ms9096 KiB
#include "railroad.h" #include<bits/stdc++.h> #define x first #define y second #define pb push_back #define eb emplace_back #define all(a) (a).begin(),(a).end() #define SZ(a) (int)(a).size() #define FOR(i, a, b) for(int i=(a); i<=(b); ++i) #define ROF(i, a, b) for(int i=(a); i>=(b); --i) #define make_unique(a) sort(all((a))), (a).resize(unique(all((a)))-(a).begin()) using namespace std; typedef pair<int,int> PII; typedef long long LL; typedef double DD; typedef long double LD; typedef pair<LL,LL> PLL; typedef pair<DD,DD> PDD; typedef vector<int> VI; typedef vector<LL> VL; int n; LL plan_roller_coaster(VI s, VI t) { int n = SZ(s); vector<int> p; FOR(i,0,n-1) p.pb(s[i]); sort(all(p)); vector<int> dp(n); FOR(i,0,n-1){ int idx = lower_bound(all(p), t[i])-p.begin(); if(idx == n) continue; dp[idx]++; } dp[0]++; FOR(i,1,n-1) dp[i] += dp[i-1]; FOR(i,0,n-1){ if(dp[i] <= 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...