| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 835456 | Valaki2 | 도시들 (IOI15_towns) | C++14 | 13 ms | 980 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "towns.h"
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e6 + 42;
int n;
vector<vector<int> > storedist;
int dist(int a, int b) {
if(storedist[a][b] != -1) {
return storedist[a][b];
}
return storedist[a][b] = storedist[b][a] = getDistance(a - 1, b - 1);
}
void reset() {
storedist.clear();
storedist.assign(1 + n, vector<int> (1 + n, -1));
for(int i = 1; i <= n; i++) {
storedist[i][i] = 0;
}
}
int hubDistance(int N, int sub) {
n = N;
reset();
int ans = inf;
int X = 1;
for(int i = 2; i <= n; i++) {
if(dist(1, i) > dist(1, X)) {
X = i;
}
}
int Y = X;
for(int i = 1; i <= n; i++) {
if(dist(X, i) > dist(X, Y)) {
Y = i;
}
}
int diam = dist(X, Y);
for(int i = 1; i <= n; i++) {
int a = dist(i, X);
int b = dist(i, Y);
int from = (a + b - diam) / 2;
ans = min(ans, max(a - from, b - from));
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
