제출 #132402

#제출 시각아이디문제언어결과실행 시간메모리
132402reda도시들 (IOI15_towns)C++14
13 / 100
21 ms1016 KiB
#include <bits/stdc++.h> #include "towns.h" using namespace std; int hubDistance( int n, int sub ) { int m[n][n], s, t, maxd = -1; for(int i = 0; i < n; i++) { m[i][i] = 0; for( int j = i+1; j < n; j++ ) { m[i][j] = getDistance(i,j); m[j][i] = m[i][j]; if( m[i][j] > maxd ) { s = i; t = j; maxd = m[i][j]; } } } int R = 1e9+1; for(int i = 0; i < n; ++i ) { if(i==s || i==t)continue ; int z = (m[i][t] - m[i][s] - maxd)/-2; int x = maxd - z; int y = m[i][s] - z; R = min(R, max(x, z)); } return R; }

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:30:17: warning: unused variable 'y' [-Wunused-variable]
             int y = m[i][s] - z; 
                 ^
towns.cpp:4:29: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance( int n, int sub )
                             ^~~
towns.cpp:27:14: warning: 's' may be used uninitialized in this function [-Wmaybe-uninitialized]
          if(i==s || i==t)continue ; 
             ~^~~
towns.cpp:27:22: warning: 't' may be used uninitialized in this function [-Wmaybe-uninitialized]
          if(i==s || i==t)continue ; 
                     ~^~~
#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...