Submission #592187

#TimeUsernameProblemLanguageResultExecution timeMemory
592187DeepessonTowns (IOI15_towns)C++17
0 / 100
17 ms980 KiB
#include <bits/stdc++.h> int getDistance(int i, int j); int hubDistance(int N, int sub); typedef std::pair<int,int> pii; pii MaisDistante(int N,int x){ int best=-1,alvo=0; for(int i=0;i!=N;++i){ if(i==x)continue; int d = getDistance(i,x); if(d>best){ best=d; alvo=i; } } return {best,alvo}; } int hubDistance(int N, int sub) { pii alpha = MaisDistante(N,0); pii beta = MaisDistante(N,alpha.second); return beta.first/2 + (beta.first&1); }

Compilation message (stderr)

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:18:28: warning: unused parameter 'sub' [-Wunused-parameter]
   18 | 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...