# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
284413 | 2020-08-27T11:20:54 Z | SamAnd | 도시들 (IOI15_towns) | C++17 | 31 ms | 1152 KB |
#include "towns.h" #include <bits/stdc++.h> using namespace std; const int N = 115, INF = 1000000009; int n; int ans[N][N]; int qry(int x, int y) { if (ans[x][y] != -1) return ans[x][y]; return ans[x][y] = ans[y][x] = getDistance(x, y); } int hubDistance(int N_, int sub) { n = N_; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (i == j) continue; ans[i][j] = -1; } } int maxu = -1; int maxx; for (int x = 0; x < n; ++x) { if (qry(0, x) > maxu) { maxu = qry(0, x); maxx = x; } } int u1 = maxx; maxu = -1; for (int x = 0; x < n; ++x) { if (qry(u1, x) > maxu) { maxu = qry(u1, x); maxx = x; } } int u2 = maxx; int R = INF; for (int x = 0; x < n; ++x) { int t1 = qry(u1, u2); int t2 = qry(u1, x); int t3 = qry(u2, x); R = min(R, max((t1 + t3 - t2) / 2, max((t1 + t2 - t3) / 2, (t2 + t3 - t1) / 2))); } return R; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 31 ms | 1024 KB | Output is correct |
2 | Correct | 15 ms | 896 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 22 ms | 896 KB | Output is correct |
5 | Correct | 22 ms | 896 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 20 ms | 1024 KB | Output is correct |
2 | Correct | 16 ms | 896 KB | Output is correct |
3 | Correct | 21 ms | 896 KB | Output is correct |
4 | Correct | 21 ms | 896 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 16 ms | 896 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 1152 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 17 ms | 896 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 896 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |