제출 #60168

#제출 시각아이디문제언어결과실행 시간메모리
60168dukati8도시들 (IOI15_towns)C++14
25 / 100
38 ms2984 KiB
#include "towns.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int i =a; i<int(b); i++) int hubDistance(int N, int sub) { int high=-1; int highind=-1; rep(i,1,N) { int dist=getDistance(0,i); if (dist>high) {high=dist; highind=i;} } int A=highind; int Adists[N]; high=-1; highind=-1; rep (i,0,N) { Adists[i]=getDistance(A,i); if (Adists[i]>high) {high=Adists[i]; highind=i;} } int B=highind; int diameter=high; int Bdists[N]; rep (i,0,N) { Bdists[i]=getDistance(B,i); } int pos[N]; rep (i,0,N) { int extra=(Adists[i]+Bdists[i]-diameter)/2; pos[i]=Adists[i]-extra; } int R=diameter; rep (i,0,N) { int newr; newr=max(pos[i],diameter-pos[i]); R=min(R,newr); } return R; }

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:5:28: warning: unused parameter 'sub' [-Wunused-parameter]
 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...