# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
96953 | tincamatei | Towns (IOI15_towns) | C++14 | 29 ms | 1208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "towns.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 110;
int hubDistance(int N, int subtask) {
int c1 = 0, c2, diam1, diam2;
vector<int> firstDist(N, 0), secondDist(N, 0), diamdist(N, 0);
c1 = -1, diam1 = -1;
for(int i = 0; i < N; ++i) {
firstDist[i] = getDistance(0, i);
if(firstDist[i] > diam1) {
diam1 = firstDist[i];
c1 = i;
}
}
diam2 = c2 = -1;
for(int i = 0; i < N; ++i) {
secondDist[i] = getDistance(c1, i);
if(secondDist[i] > diam2) {
diam2 = secondDist[i];
c2 = i;
}
}
int rez = 1000000000;
for(int i = 0; i < N; ++i) {
int ic, c0c, c1c;
ic = (firstDist[i] + secondDist[i] - diam1) / 2;
c0c = firstDist[i] - ic;
c1c = secondDist[i] - ic;
rez = min(rez, max(c1c, diam2 - c1c));
}
return rez;
}
컴파일 시 표준 에러 (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... |