제출 #1029668

#제출 시각아이디문제언어결과실행 시간메모리
1029668sleepntsheep도시들 (IOI15_towns)C11
13 / 100
10 ms928 KiB
#include "towns.h" int z; int l(int i, int j){return i<j?i:j;} int h(int i, int j){return i>j?i:j;} int ask(int i, int j) { return i-j ? getDistance(i, j): 0; } int argmax(int x, int N) { int mx = 0, dist = -1; for (int y, i = 0; i < N; ++i) if (dist < (y = ask(x, i))) dist = y, mx = i, z = dist; return mx; } int hubDistance(int N, int sub) { int d1 = argmax(0, N); int d2 = argmax(d1, N); int dd = z; int R = 1e9; for (int i = 0; i < N; ++i) { if (d1 == i || d2 == i) continue; int a=ask(d1,i),b=ask(d2,i); int branch = (a+b-dd)/2; R=l(R,h(a,b)-branch); } return R; }

컴파일 시 표준 에러 (stderr) 메시지

towns.c: In function 'hubDistance':
towns.c:17:28: warning: unused parameter 'sub' [-Wunused-parameter]
   17 | int hubDistance(int N, int sub) {
      |                        ~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...