# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
125887 | zozder | 철로 (IOI14_rail) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#include <iostream>
#include <cstdlib>
using namespace std;
int l[10000][2];//到0的路
int mnl;
int compare(const void *x , const void *y)
{
return ((int*)x)[1] - ((int*)y)[1];
}
int gD(int x, int y)
{
return getDistance(x,y);
}
void findLocation(int N, int first, int location[], int stype[])
{
location[0]=first;
stype[0]=1;
for(int i=1;i<N;i++)
{
l[i][0]=i;
l[i][1]=gD(0,i);
}
qsort(l+1,N-1,sizeof(int)*2,compare);
int p=1;
mnl=l[p][0];
p++;
while(p<N)
{
int a,b,c;
a=l[1][1];
b=l[p][1];
c=gD(mnl,l[p][0]);
if(a+b=c)
{
location
}
}
}