Submission #50224

#TimeUsernameProblemLanguageResultExecution timeMemory
50224antimirageRail (IOI14_rail)C++17
30 / 100
93 ms724 KiB
#include "rail.h" #include <bits/stdc++.h> using namespace std; const int N = 105; int ar[2][N]; void findLocation(int n, int first, int ans[], int type[]) { type[0] = 1; ans[0] = first; int in = 1; for (int i = 1; i < n; i++) { ar[0][i] = getDistance( 0, i ); if (ar[0][in] > ar[0][i]) in = i; } for (int i = 1; i < n; i++) ar[1][i] = getDistance( in, i ); for (int i = 1; i < n; i++) { if ( i == in ) { type[i] = 2; ans[i] = first + ar[0][in]; continue; } if (ar[0][i] > ar[1][i]) { type[i] = 1; ans[i] = first + ar[0][in] - ar[1][i]; } else { type[i] = 2; ans[i] = first + ar[0][i]; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...