Submission #813611

#TimeUsernameProblemLanguageResultExecution timeMemory
813611LiudasRail (IOI14_rail)C++17
30 / 100
46 ms468 KiB
#include "rail.h" #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <bits/stdc++.h> using namespace std; void findLocation(int N, int f, int loc[], int st[]){ st[0] = 1; loc[0] = f; int md = 1e9, id = 0; for(int i = 1; i < N; i ++){ int c = getDistance(0, i); if(md > c){ md = c; id = i; } } for(int i = 1; i < N; i ++){ int c1 = getDistance(0, i); int c2 = getDistance(id, i); if(c1 > c2 && c2 != 0){ st[i] = 1; loc[i] = f - c2 + md; } else{ st[i] = 2; loc[i] = f + c1; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...