Submission #20194

#TimeUsernameProblemLanguageResultExecution timeMemory
20194suhgyuho_williamTowns (IOI15_towns)C++98
0 / 100
21 ms4 KiB
#include "towns.h" #include <algorithm> using namespace std; int R; int a[150][150]; int hubDistance(int N, int sub) { int i,x; int v,big; for(i=1; i<N; i++) a[0][i] = a[i][0] = getDistance(0,i); big = 0; for(i=1; i<N; i++){ if(big < a[0][i]){ big = a[0][i]; v = i; } } for(i=1; i<N; i++){ if(i == v) continue; a[v][i] = a[i][v] = getDistance(i,v); } R = 0; for(i=1; i<N; i++){ if(i == v) continue; x = a[0][i]+a[v][i]-big; x /= 2; R = max(R,max(a[0][i]-x,a[v][i]-x)); } return R; }

Compilation message (stderr)

towns.cpp:9:28: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance(int N, int sub) {
                            ^
towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:11:6: warning: 'v' may be used uninitialized in this function [-Wmaybe-uninitialized]
  int v,big;
      ^
#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...