# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
288441 | shayan_p | Towns (IOI15_towns) | C++17 | 22 ms | 896 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "towns.h"
#define F first
#define S second
#define PB push_back
#define sz(s) (int(s.size()))
#define bit(n, k) (((n)>>(k))&1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
const int maxn = 1e5 + 10, mod = 1e9 + 7, inf = 1e9 + 7;
int n;
int ds[2][maxn], h[maxn], D[maxn];
int far(int u, int o){
ds[o][u] = 0;
for(int i = 0; i < n; i++){
if(i != u)
ds[o][i] = getDistance(u, i);
}
int mx = 0;
for(int i = 0; i < n; i++){
if(ds[o][mx] < ds[o][i])
mx = i;
}
return mx;
}
int hubDistance(int n, int sub){
::n = n;
int A = far(0, 0);
int B = far(A, 0);
far(B, 1);
vector<int> vec;
int R = inf;
for(int i = 0; i < n; i++){
h[i] = (ds[0][i] + ds[1][i] - ds[0][B]) / 2;
D[i] = ds[0][i] - h[i];
vec.PB(D[i]);
R = min(R, max(D[i], ds[0][B] - D[i]));
}
return R;
}
컴파일 시 표준 에러 (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... |