# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432772 | 2021-06-18T13:14:30 Z | daniel920712 | Towns (IOI15_towns) | C++14 | 18 ms | 420 KB |
#include "towns.h" #include <stdio.h> #include <map> #include <set> using namespace std; int all[205][205]={0}; map < int , int > tt; int hubDistance(int N, int sub) { int i,j,k,ans=2e9,a,b,c,x,y,z,now=0,aa,bb; for(i=0;i<N;i++) { for(j=i+1;j<N;j++) { all[i][j]=all[j][i]=getDistance(i,j); if(all[i][j]>now) { now=all[i][j]; aa=i; bb=j; } } } i=aa; j=bb; for(k=0;k<N;k++) { if(i==k) continue; if(j==k) continue; a=all[i][j]; b=all[i][k]; c=all[j][k]; z=(a+b+c)/2-a; y=(a+b+c)/2-b; x=(a+b+c)/2-c; tt[x]=max(tt[x],max(max(x,y),z)); } for(auto k:tt) { ans=min(ans,a-k.first); } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 18 ms | 420 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 420 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |