Submission #14755

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
147552015-06-21 11:59:10progressiveRail (IOI14_rail)C++98
30 / 100
334 ms99100 KiB
#include "rail.h"
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
static int di[5010][5010];
static int d(int i,int j)
{
if(!di[i][j]) di[i][j]=getDistance(i,j);
return di[i][j];
}
void findLocation(int N, int first, int location[], int stype[])
{
memset(di,0,sizeof(di));
const int Ctype=1;
const int Dtype=2;
for(int i=0;i<N;i++) stype[i]=0;
stype[0]=Ctype;
location[0]=0;
//initialize, assume location of eki 0 is 0
if(N==1) return;
vector< pair<int, int> > D0;
for(int i=1;i<N;i++)
D0.push_back(make_pair(d(0,i),i));
sort(D0.begin(),D0.end());
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...