제출 #598801

#제출 시각아이디문제언어결과실행 시간메모리
598801fuad27철로 (IOI14_rail)C++17
30 / 100
71 ms468 KiB
#include "rail.h" #include<bits/stdc++.h> using namespace std; void findLocation(int N, int first, int location[], int stype[]) { stype[0]=1; location[0]=first; int mn = 1e9, idx=0; for(int i =1;i<N;i++) { int k = getDistance(0,i); if(k < mn) { mn=k; idx=i; } } stype[idx]=2; location[idx]=first+mn; for(int i = 1;i<N;i++) { if(i==idx)continue; int k1=getDistance(0,i), k2=getDistance(idx,i); if(k1 < k2) { stype[i]=2; location[i]=first+k1; } else { stype[i]=1; location[i]=location[idx]-k2; } } // for(int i = 1;i<N;i++) { // cout << stype[i] << " " << location[i] << "\n"; // } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...