Submission #396796

#TimeUsernameProblemLanguageResultExecution timeMemory
396796peuchRail (IOI14_rail)C++17
30 / 100
87 ms432 KiB
#include "rail.h" #include<bits/stdc++.h> using namespace std; void findLocation(int N, int first, int location[], int stype[]) { int dist[N]; dist[0] = 0, location[0] = first, stype[0] = 1; if(N == 1) return; int mini = 2e6 + 10, id = 0; for(int i = 1; i < N; i++){ dist[i] = getDistance(0, i); if(dist[i] < mini) mini = dist[i], id = i; } location[id] = first + dist[id]; stype[id] = 2; for(int i = 1; i < N; i++){ if(i == id) continue; int d = getDistance(id, i); if(d + mini == dist[i]) location[i] = location[id] - d, stype[i] = 1; else location[i] = first + dist[i], stype[i] = 2; } return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...