제출 #431967

#제출 시각아이디문제언어결과실행 시간메모리
431967arayi도시들 (IOI15_towns)C++17
0 / 100
4 ms844 KiB
#include "towns.h" #include <bits/stdc++.h> using namespace std; const int N = 150; int n; int d[N][N]; int hubDistance(int N, int sub) { for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) d[i][j] = 0; n = N; int a = 0; for (int i = 1; i < n; i++) { d[0][i] = d[i][0] = getDistance(0, i); if(d[0][i] > d[0][a]) a = i; } int b = 0; for (int i = 1; i < n; i++) { if(a == i) continue; d[a][i] = d[i][a] = getDistance(a, i); if(d[a][i] > d[a][b]) b = i; } int pat = d[a][b]; for (int i = 0; i < n; i++) { if(i == a || i == b) continue; int c = (d[a][i]+d[i][b] - d[a][b]); assert(c%2 == 0); c/=2; pat = min(pat, max(d[a][i], d[i][b]) - c); } return pat; }

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:9:21: warning: declaration of 'N' shadows a global declaration [-Wshadow]
    9 | int hubDistance(int N, int sub)
      |                 ~~~~^
towns.cpp:5:11: note: shadowed declaration is here
    5 | const int N = 150;
      |           ^
towns.cpp:9:28: warning: unused parameter 'sub' [-Wunused-parameter]
    9 | 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...