제출 #96548

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
965482019-02-10 09:11:37janlivens도시들 (IOI15_towns)C++14
컴파일 에러
0 ms0 KiB
// This Program is made by Jan(Codezebra)
#include<bits/stdc++.h>
#include "towns.h"
#define int long long
#define INF 0x3f3f3f3f
using namespace std;
int hubDistance(int n,int sub){
int dist[n][n];
int mx=0,my=0,ma=0;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
dist[i][j]=getDistance(i,j);
dist[j][i]=dist[i][j];
if(dist[i][j]>ma){
mx=i;
my=j;
ma=dist[i][j];
}
}
}
int ans=INF
for(int i=0;i<n;i++){
int a=dist[mx][my],b=dist[mx][i],c=dist[my][i];
ans=min(ans,max(a+b-c,max(a-b+c,-a+b+c)));
}
return ans;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

towns.cpp: In function 'long long int hubDistance(long long int, long long int)':
towns.cpp:13:30: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
    dist[i][j]=getDistance(i,j);
                              ^
towns.cpp:13:30: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
towns.cpp:23:2: error: expected ',' or ';' before 'for'
  for(int i=0;i<n;i++){
  ^~~
towns.cpp:23:14: error: 'i' was not declared in this scope
  for(int i=0;i<n;i++){
              ^
towns.cpp:8:27: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance(int n,int sub){
                           ^~~