Submission #74219

# Submission time Handle Problem Language Result Execution time Memory
74219 2018-08-30T13:39:07 Z MKopchev Towns (IOI15_towns) C++14
0 / 100
20 ms 528 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=i+1;j<N;j++)
            if(dist[p][q]>dist[i][j])p=i,j=q;

    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,dist[p][q]-n1);
        mini=min(mini,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 Incorrect 20 ms 380 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 528 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 528 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 528 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 528 KB Output isn't correct
2 Halted 0 ms 0 KB -