Submission #7543

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
75432014-08-10 14:55:16baneling100Rail (IOI14_rail)C++98
100 / 100
148 ms2232 KiB
#include "rail.h"
#include <algorithm>
#include <vector>
using namespace std;
pair <int,int> A[5000];
vector <int> Up;
vector <int> Down;
int Check[5000];
void findLocation(int N, int First, int location[], int stype[])
{
int i, j, k, Left, Right, Dist, OK;
location[0]=First;
stype[0]=1;
for(i=1 ; i<N ; i++)
A[i]=make_pair(getDistance(0,i),i);
sort(A,A+N);
location[A[1].second]=location[0]+A[1].first;
stype[A[1].second]=2;
for(i=2 ; i<N ; i++)
{
Dist=getDistance(A[1].second,A[i].second);
if(A[i].first==A[1].first+Dist && location[A[1].second]-Dist<location[0])
Check[A[i].second]=Dist;
}
Right=A[1].second;
Up.push_back(A[1].second);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...