| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 708969 | victor_gao | 도시들 (IOI15_towns) | C++17 | 14 ms | 852 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "towns.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define x first
#define y second
using namespace std;
map<pii,int>mp;
int s,t,d; // 直徑兩端點
int query(int a,int b){
if (a==b) return 0;
if (!mp[{a,b}]){
int dis=getDistance(a,b);
mp[{a,b}]=dis;
mp[{b,a}]=dis;
}
return mp[{a,b}];
}
int hubDistance(int N, int sub) {
d=-1;
for (int i=1;i<N;i++){
if (d<query(0,i)){
d=query(0,i);
s=i;
}
}
d=-1;
for (int i=0;i<N;i++){
if (d<query(s,i)){
d=query(s,i);
t=i;
}
}
int ans=1e9;
for (int i=0;i<N;i++){
int a=query(0,i);
int b=query(i,s);
int c=query(0,s);
int tmp=(c-a+b)/2;
ans=min(ans,max(d-tmp,tmp));
}
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... | ||||
