# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
638617 | ggoh | Rail (IOI14_rail) | C++14 | 100 ms | 48684 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<bits/stdc++.h>
using namespace std;
#define sz(v) ((int)(v).size())
typedef pair<int,int> pii;
int dis[5005][5005],minind,ind[2000002];
void findLocation(int n, int first, int location[], int stype[])
{
location[0]=first;
stype[0]=1;
if(n==1)return ;
for(int i=1;i<n;i++)
{
dis[0][i]=dis[i][0]=getDistance(0,i);
if(!minind || dis[0][minind]>dis[0][i])minind=i;
}
int c0,d0;
d0=minind;
location[d0]=location[0]+dis[0][d0];
stype[d0]=2;
minind=d0;
for(int i=0;i<n;i++)
{
if(i==d0)continue;
dis[d0][i]=dis[i][d0]=getDistance(d0,i);
if(minind==d0 || dis[d0][minind]>dis[d0][i])minind=i;
}
c0=minind;
# | 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... |