# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
14755 | progressive | Rail (IOI14_rail) | C++98 | 334 ms | 99100 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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());
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |