제출 #959285

#제출 시각아이디문제언어결과실행 시간메모리
959285hyakupRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
362 ms15776 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; #define ll long long const ll inf = 1e9 + 10; ll plan_roller_coaster( vector<int> ini, vector<int> fim ){ int n = ini.size(); set<pair<int, int>> s; vector<int> marc(n); for( int i = 0; i < n; i++ ) s.insert({ ini[i], i }); s.insert({ inf, n }); int cur = s.begin()->second; s.erase(s.begin()); while( cur != n ){ cout << "CUR " << cur << endl; auto [pos, viz] = *s.lower_bound({fim[cur], -1}); marc[cur] = true; s.erase({ pos, viz }); cur = viz; } for( int i = 0; i < n; i++ ) if( marc[i] == 0 ) 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...