Submission #50248

#TimeUsernameProblemLanguageResultExecution timeMemory
50248mirbek01철로 (IOI14_rail)C++17
0 / 100
101 ms736 KiB
#include "rail.h" #include <bits/stdc++.h> using namespace std; void findLocation(int N, int first, int location[], int stype[]){ location[0] = first; stype[0] = 1; if(N <= 1) return ; int mn = 1e9, id = 1; for(int i = 1; i < N; i ++){ int x = getDistance(0, i); if(mn > x){ mn = x; id = i; } } stype[id] = 2; location[id] = first + mn; for(int i = 1; i < N; i ++){ int x = getDistance(id, i); int y = getDistance(0, i); if(y == mn + x){ stype[i] = 2; location[i] = first + y; } else { stype[i] = 1; location[i] = mn - x; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...