Submission #719155

#TimeUsernameProblemLanguageResultExecution timeMemory
719155mseebacherRail (IOI14_rail)C++17
0 / 100
70 ms468 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; int second = 0; int mn = 1e9; for(int i = 1;i<n;i++){ if(getDistance(0,i) < mn){ mn = getDistance(0,i); second = i; } } stype[second] = 2; location[second] = location[0]+mn; for(int i = 1;i<n;i++){ if(i == second) continue; if(getDistance(0,i) < getDistance(second,i)){ stype[i] = 2; location[i] = location[second] + getDistance(0,i); }else{ stype[i] = 1; location[i] = location[second] - getDistance(second,i); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...