제출 #596558

#제출 시각아이디문제언어결과실행 시간메모리
596558Elias철로 (IOI14_rail)C++17
0 / 100
77 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 = 0; i < n; i++) distA[i] = getDistance(a, i); distA[a] = 10000000; int b = min_element(distA.begin(), distA.end()) - distA.begin(); location[b] = distA[b] + first; for (int i = 0; i < n; i++) distB[i] = 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...