제출 #1011703

#제출 시각아이디문제언어결과실행 시간메모리
1011703hotboy2703도시들 (IOI15_towns)C++17
25 / 100
14 ms1116 KiB
#include "towns.h" #include<bits/stdc++.h> using namespace std; using ll = int; #define pll pair <ll,ll> #define fi first #define se second #define MP make_pair #define sz(a) (ll((a).size())) #define BIT(mask,i) (((mask) >> (i))&1) #define MASK(i) (1LL << (i)) const ll MAXN = 120; ll dist[3][MAXN]; ll n; ll get_dist(ll u,ll d[]){ ll res = 0; for (ll i = 0;i < n;i ++){ if (i == u){ d[u] = 0; } else{ d[i] = getDistance(i,u); if (d[res] < d[i])res = i; } } return res; } int hubDistance(int N, int sub) { n=N; ll a = get_dist(0,dist[0]); ll b = get_dist(a,dist[1]); get_dist(b,dist[2]); ll res = 1e9; for (ll i = 0;i < n;i ++){ ll ab,ac,bc,abc; ab = dist[1][b]; ac = dist[1][i]; bc = dist[2][i]; abc = (ab+ac+bc)/2; res = min(res,max(abc-bc,abc-ac)); } // cout<<a<<' '<<b<<'\n'; return res; }

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:29:28: warning: unused parameter 'sub' [-Wunused-parameter]
   29 | int hubDistance(int N, int sub) {
      |                        ~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...