Submission #959286

#TimeUsernameProblemLanguageResultExecution timeMemory
959286hyakupRoller Coaster Railroad (IOI16_railroad)C++17
0 / 100
152 ms17584 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 ){ 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...