제출 #789894

#제출 시각아이디문제언어결과실행 시간메모리
789894SupersonicRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
834 ms9048 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { int n = (int) s.size(); vector<pair<int,int>> st; for(int i=0;i<n;i++){ st.push_back({s[i],t[i]}); } sort(st.begin(),st.end(), [&](pair<int,int> x,pair<int,int> y){if(x.first == y.first)return (x.second>y.second);return (x.first<y.first);}); for(auto i:st){cerr<<i.first<<' '<<i.second<<endl;} long long sp=0; for(int i=0;i<n;i++){ if(st[i].first>sp)return 1; else sp+=st[i].second; } 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...