제출 #151449

#제출 시각아이디문제언어결과실행 시간메모리
151449Bodo171도시들 (IOI15_towns)C++14
0 / 100
20 ms412 KiB
#include "towns.h" #include <iostream> #include <algorithm> #include <vector> using namespace std; const int nmax=205; int n; int d[2][nmax]; int to[nmax],wh[nmax],sz[nmax]; int hubDistance(int N, int sub) { int d1=0,R=0,mx=0,d2=0; n=N; for(int i=1; i<n; i++) { d[0][i]=getDistance(0,i); if(d[0][i]>d[0][d1]) d1=i; } for(int i=0; i<n; i++) if(i!=d1) { d[1][i]=getDistance(d1,i); if(d[1][i]>mx) mx=d[1][i],d2=i; } int minDist=(1<<30); int lim=d[1][d2]-(d[0][d2]+d[1][d2]-d[0][d1])/2; for(int i=0; i<n; i++) { to[i]=(d[0][i]+d[1][i]-d[0][d1])/2; wh[i]=(d[1][i]-to[i]); if(max(wh[i],mx-wh[i])<minDist&&wh[i]<=lim) minDist=max(wh[i],mx-wh[i]); } R=minDist; return R; }

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:13: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...