Submission #432605

#TimeUsernameProblemLanguageResultExecution timeMemory
432605daniel920712Towns (IOI15_towns)C++14
0 / 100
24 ms964 KiB
#include "towns.h" #include <iostream> using namespace std; int all[205][205]={0}; int hubDistance(int N, int sub) { int i,j,k,ans=0,a,b,c; for(i=0;i<N;i++) { for(j=i+1;j<N;j++) all[i][j]=all[j][i]=getDistance(i,j); } for(i=0;i<N;i++) { for(j=i+1;j<N;j++) { for(k=j+1;k<N;k++) { a=all[i][j]; b=all[i][k]; c=all[j][k]; ans=max(ans,(a+b+c)/2-a); ans=max(ans,(a+b+c)/2-b); ans=max(ans,(a+b+c)/2-c); } } } return ans; }

Compilation message (stderr)

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