# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
295749 | peti1234 | 도시들 (IOI15_towns) | C++17 | 24 ms | 1024 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "towns.h"
using namespace std;
const int c=112;
int dist[c][c], a, b, h, n, mini;
/*
int getDistance(int a, int b) {
//cout << a << " " << b << "\n";
int x; cin >> x;
return x;
}
*/
int tav(int a, int b) {
if (a==b) return 0;
if (!dist[a][b]) dist[a][b]=getDistance(a, b), dist[b][a]=dist[a][b];
return dist[a][b];
}
int tavol(int x) {
int pos=0;
for (int i=0; i<n; i++) {
int p=tav(x, i);
if (p>tav(x,pos)) pos=i;
}
return pos;
}
int hubDistance(int q, int w) {
n=q;
for (int i=0; i<n; i++) for (int j=0; j<n; j++) dist[i][j]=0;
a=tavol(0), b=tavol(a), h=tav(a, b), mini=h;
for (int i=0; i<n; i++) {
int x=tav(a, 0), y=tav(a, i), z=tav(i, 0), p=(x+y-z)/2;
//cout << "lehet " << i << " " << x << " " << y << " " << z << " " << p << "\n";
mini=min(mini, max(p, h-p));
}
return mini;
}
컴파일 시 표준 에러 (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... |