제출 #348514

#제출 시각아이디문제언어결과실행 시간메모리
348514juggernaut철로 (IOI14_rail)C++14
30 / 100
86 ms492 KiB
#include"rail.h" #include<bits/stdc++.h> #ifndef EVAL #include"grader.cpp" #endif using namespace std; pair<int,int>a[5005]; void findLocation(int n,int first,int location[],int stype[]){ stype[0]=1,location[0]=first; for(int i=1;i<n;i++)a[i]={getDistance(0,i),i}; sort(a+1,a+n); int x=a[1].second; location[x]=first+a[1].first; stype[x]=2; int tmp=a[1].first<<1; for(int i=2;i<n;i++){ int y=a[i].second; int d=getDistance(x,y); if (d>a[i].first){ location[y]=first+a[i].first; stype[y]=2; }else{ location[y]=first-a[i].first+tmp; stype[y]=1; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...