Submission #1019972

#TimeUsernameProblemLanguageResultExecution timeMemory
1019972amine_arouaRail (IOI14_rail)C++17
0 / 100
41 ms608 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 == im) 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...