Submission #74225

# Submission time Handle Problem Language Result Execution time Memory
74225 2018-08-30T13:44:17 Z MKopchev Towns (IOI15_towns) C++14
13 / 100
28 ms 652 KB
#include<bits/stdc++.h>
#include "towns.h"
using namespace std;
const int nmax=1e2+42;
int dist[nmax][nmax];
int hubDistance(int N,int sub)
{
    for(int i=0;i<N;i++)
        for(int j=i+1;j<N;j++)
        {
        int d=getDistance(i,j);
        dist[i][j]=d;
        dist[j][i]=d;
        }
    int p=0,q=0;
    for(int i=0;i<N;i++)
        for(int j=0;j<N;j++)
            if(dist[p][q]<dist[i][j])p=i,q=j;

    int mini=1e9;
    for(int k=0;k<N;k++)
    {
        int n1=(dist[p][q]+dist[k][p]-dist[k][q])/2;
        mini=min(mini,max(n1,dist[p][q]-n1));
    }
    return mini;
}

Compilation message

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:6:27: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance(int N,int sub)
                           ^~~
# Verdict Execution time Memory Grader output
1 Correct 21 ms 376 KB Output is correct
2 Correct 17 ms 500 KB Output is correct
3 Correct 2 ms 500 KB Output is correct
4 Correct 22 ms 592 KB Output is correct
5 Correct 28 ms 652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 652 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 652 KB Output isn't correct
2 Halted 0 ms 0 KB -