제출 #135234

#제출 시각아이디문제언어결과실행 시간메모리
135234arthurconmy철로 (IOI14_rail)C++14
30 / 100
83 ms520 KiB
#include <bits/stdc++.h> #ifndef ARTHUR_LOCAL #include "rail.h" #endif using namespace std; int dis[2][100]; void findLocation(int n, int first, int location[], int stype[]) { location[0]=first; stype[0]=1; pair<int,int> ming = {int(1e9),int(1e9)}; for(int i=1; i<n; i++) { int cur_dis = getDistance(0,i); dis[0][i]=cur_dis; ming = min(ming,{cur_dis,i}); } location[ming.second]=first+ming.first; stype[ming.second]=2; for(int i=1; i<n; i++) { dis[1][i] = getDistance(ming.second,i); } for(int i=1; i<n; i++) { if(i==ming.second) continue; if(dis[0][i] < dis[1][i]) { stype[i]=2; location[i] = location[0] + dis[0][i]; } else { stype[i]=1; location[i] = location[ming.second] - dis[1][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...