제출 #286447

#제출 시각아이디문제언어결과실행 시간메모리
286447abyyskit도시들 (IOI15_towns)C++14
13 / 100
623 ms632 KiB
#include "towns.h" #include<bits/stdc++.h> using namespace std; #define FOR(i, x, y) for(int i = x; i < y; ++i) #define pb push_back vector<vector<int>> D; //int getDistance(int a, int b){ // return D[a][b]; //} int hubDistance(int N, int sub) { //int R = getDistance(0,1); vector<vector<int>> d(N, vector<int> (N)); FOR(i, 0, N){ FOR(j, i + 1, N){ d[i][j] = getDistance(i, j); d[j][i] = d[i][j]; } } int ans = INT_MAX; FOR(i, 0, N){ FOR(j, i + 1, N){ FOR(k, j + 1, N){ int big = 0; int tmp = d[i][j] + d[j][k] + d[k][i]; int a = tmp - 2*d[j][k]; int b = tmp - 2*d[i][k]; int c = tmp - 2*d[i][j]; a /= 2; b /= 2; c /= 2; FOR(h, 0, N){ int as = d[h][i] - a; int bs = d[h][j] - b; int cs = d[h][k] - c; if (as == bs){ big = max(big, as); } else if (as == cs){ big = max(big, as); } else{ big = max(big, bs); } } ans = min(ans, big); } } } //cout << ans << "\n"; return ans; } /*int main(){ int n, s; ifstream fin("towns.in"); fin >> n >> s; fin >> n; D.resize(n, vector<int>(n)); FOR(i, 0, n){ FOR(j, 0, n){ fin >> D[i][j]; } } hubDistance(n, s); }*/

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:12:28: warning: unused parameter 'sub' [-Wunused-parameter]
   12 | 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...