제출 #719147

#제출 시각아이디문제언어결과실행 시간메모리
719147mseebacher철로 (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...