제출 #1022094

#제출 시각아이디문제언어결과실행 시간메모리
1022094amirhoseinfar1385Roller Coaster Railroad (IOI16_railroad)C++17
0 / 100
88 ms9668 KiB
#include "railroad.h" #include<bits/stdc++.h> using namespace std; vector<int>allind; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); vector<pair<int,int>>v; v.push_back(make_pair(0,1)); for(int i=0;i<n;i++){ v.push_back(make_pair(t[i],s[i])); } sort(v.begin(),v.end()); vector<int>ps(n+1); for(int i=1;i<=n;i++){ int p=lower_bound(v.begin(),v.end(),make_pair(v[i].second+1,-1))-v.begin(); p--; ps[p]++; } for(int i=1;i<=n;i++){ ps[i]+=ps[i-1]; } for(int i=0;i<=n;i++){ if(ps[i]>i+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...