제출 #409430

#제출 시각아이디문제언어결과실행 시간메모리
409430robs철로 (IOI14_rail)C++17
30 / 100
94 ms448 KiB
#include "rail.h" #define debug(args...) fprintf(stderr, args) const int maxn = 5e5, INF = 1e9; int d[maxn], r[maxn], mn, id; void findLocation(int N, int first, int location[], int stype[]) { mn = INF; for(int x = 1; x < N; x++) d[x] = getDistance(0, x); for(int x = 1; x < N; x++) if(d[x] < mn) { mn = d[x]; id = x; } location[0] = first; stype[0] = 1; location[id] = first+d[id]; stype[id] = 2; for(int x = 1; x < N; x++) r[x] = getDistance(id, x); for(int x = 1; x < N; x++) { if(x == id) continue; if(d[x] < r[x]) { location[x] = first+d[x]; stype[x] = 2; } else { location[x] = location[id]-r[x]; stype[x] = 1; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...