제출 #1019968

#제출 시각아이디문제언어결과실행 시간메모리
1019968amine_aroua철로 (IOI14_rail)C++17
0 / 100
41 ms604 KiB
#include "rail.h" #include<bits/stdc++.h> using namespace std; void findLocation(int N, int p0, int location[], int stype[]) { int mn = 1e9; int pm = 0; int im = 0; location[0] = p0; stype[0] = 1; for(int i = 1 ; i < N ; i++) { int d = getDistance(0 , i); if(mn > d) { mn = d; pm = d + p0; im = i; } } location[im] = pm; stype[im] = 2; for(int i = 1 ; i < N ; i++) { if(i == pm) continue; int d = getDistance(0 , i); int pi = 2 * pm - p0 - d; if(pi < p0 && pi >= 0 && pi != pm) { location[i] = pi; stype[i] = 1; } else { location[i] = getDistance(0 , i) + p0; stype[i] = 2; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...