Submission #640239

#TimeUsernameProblemLanguageResultExecution timeMemory
640239ggohTowns (IOI15_towns)C++14
13 / 100
17 ms980 KiB
#include "towns.h" #include<bits/stdc++.h> using namespace std; #define sz(v) ((int)(v).size()) typedef long long lint; int dis[111][111]; int hubDistance(int N, int sub) { int maxi=-1,maxj=-1,maxx=-1; int R=1e9; for(int i=0;i<N;i++) { for(int j=i+1;j<N;j++) { dis[i][j]=dis[j][i]=getDistance(i,j); if(dis[i][j]>maxx) { maxx=dis[i][j]; maxi=i; maxj=j; } } } vector<int>X; for(int i=0;i<N;i++) { if(i!=maxi && i!=maxj) { X.push_back((dis[maxi][i]-dis[maxj][i]+maxx)/2); } } sort(X.begin(),X.end()); for(auto &k:X) { R=min(R,max(maxx-k,k)); } return R; }

Compilation message (stderr)

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