Submission #596555

#TimeUsernameProblemLanguageResultExecution timeMemory
596555EliasRail (IOI14_rail)C++17
0 / 100
65 ms468 KiB
#include <bits/stdc++.h> using namespace std; #ifndef _DEBUG #include "rail.h" #endif #ifdef _DEBUG int getDistance(int i, int j) { return -1; } #endif int n; vector<bool> found; void findLocation(int n, int first, int location[], int stype[]) { ::n = n; location[0] = first; stype[0] = 1; int a = 0; vector<int> distA(n); vector<int> distB(n); for (int i = 1; i < n; i++) distA.push_back(getDistance(a, i)); distA[0] = 10000000; int b = min_element(distA.begin(), distA.end()) - distA.begin(); location[b] = distA[b] + first; for (int i = 0; i < n; i++) distB.push_back(getDistance(b, i)); distB[b] = 10000000; for (int i = 0; i < n; i++) { if (i == a || i == b) continue; if (distA[i] < distB[i]) { stype[i] = 2; location[i] = location[a] + distA[i]; } else { stype[i] = 1; location[i] = location[b] - distB[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...