# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
127108 | 2019-07-08T22:34:04 Z | dragonslayerit | 도시들 (IOI15_towns) | C++14 | 21 ms | 1016 KB |
#include "towns.h" #include <algorithm> int findfar(int N,int x){ int y=x; int dist=0; for(int i=0;i<N;i++){ if(i==x) continue; int tmp=getDistance(i,x); if(tmp>dist){ dist=tmp; y=i; } } return y; } int hubDistance(int N, int sub) { int x=findfar(N,0); int y=findfar(N,x); int dxy=getDistance(x,y); int R=dxy; for(int i=0;i<N;i++){ if(i==x||i==y) continue; int dxi=getDistance(x,i); int dyi=getDistance(y,i); R=std::min(R,std::max((dxi+dxy-dyi)/2,(dyi+dxy-dxi)/2)); } return R; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 19 ms | 1016 KB | Output is correct |
2 | Correct | 15 ms | 888 KB | Output is correct |
3 | Correct | 2 ms | 252 KB | Output is correct |
4 | Correct | 21 ms | 888 KB | Output is correct |
5 | Correct | 21 ms | 896 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 16 ms | 760 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |