Submission #59676

# Submission time Handle Problem Language Result Execution time Memory
59676 2018-07-22T22:33:40 Z reality Towns (IOI15_towns) C++17
0 / 100
38 ms 1688 KB
#include "towns.h"
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}

const int N = 256;

int D[N][N];

int hubDistance(int n, int sub) {
	vector < pair < int , pii > > e;
	for (int i = 0;i < n;++i)
		for (int j = 0;j < i;++j)
			D[i][j] = D[j][i] = getDistance(i,j);
	vi v;
	for (int i = 0;i < n;++i) {
		int mx = 0;
		for (int j = 0;j < n;++j)
			smax(mx,D[i][j]);
		v.pb(mx);
	}
	return min_element(all(v)) - v.begin();
}

Compilation message

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:34:29: warning: conversion to 'int' from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type {aka long int}' may alter its value [-Wconversion]
  return min_element(all(v)) - v.begin();
         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
towns.cpp:22:28: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance(int n, int sub) {
                            ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 1016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1156 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 1648 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1648 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1648 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1688 KB Output isn't correct
2 Halted 0 ms 0 KB -