Submission #557682

#TimeUsernameProblemLanguageResultExecution timeMemory
557682sidonTowns (IOI15_towns)C++17
25 / 100
19 ms380 KiB
#include <bits/stdc++.h> #include "towns.h" using namespace std; int hubDistance(int N, int _) { int d[N][N] {}, x {}; for(int i = 1; i < N; ++i) if((d[0][i] = getDistance(0, i)) > d[0][x]) x = i; int y = x; for(int i = 0; i < N; ++i) if((d[x][i] = getDistance(x, i)) > d[x][y]) y = i; int R = 1e6; for(int i = 0; i < N; ++i) { int c = (d[x][i] - d[0][i] + d[0][x]) / 2; R = min(R, max(c, d[x][y] - c)); } return R; }

Compilation message (stderr)

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