Submission #719147

#TimeUsernameProblemLanguageResultExecution timeMemory
719147mseebacherRail (IOI14_rail)C++17
0 / 100
326 ms696 KiB
#include "rail.h" #include <bits/stdc++.h> using namespace std; void findLocation(int n, int first, int location[], int stype[]) { stype[0] = 1; location[0] = first; set<int> se; for(int i = 1;i<n;i++) se.insert(i); int last = 0; for(int i = 1;i<n;i++){ int mn = 1e9; int rail = -1; for(set<int>::iterator it = se.begin();it != se.end();it++){ int x = getDistance(last,*it); if(x < mn){ mn = x; rail = *it; } } se.erase(rail); if(i & 1){ location[rail] = location[last] + mn; stype[rail] = 2; }else{ location[rail] = location[last] - mn; stype[rail] = 1; } last = rail; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...