| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 113284 | TadijaSebez | 도시들 (IOI15_towns) | C++11 | 18 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "towns.h"
#include <bits/stdc++.h>
using namespace std;
const int N=120;
int n,cen,den;
int a[N],b[N],c[N];
int hubDistance(int _N, int sub)
{
n=_N;cen=den=0;
for(int i=0;i<n;i++) a[i]=b[i]=c[i]=0;
for(int i=1;i<n;i++)
{
a[i]=getDistance(0,i);
if(a[i]>a[cen]) cen=i;
}
for(int i=0;i<n;i++) if(i!=cen)
{
b[i]=getDistance(cen,i);
if(b[i]>b[den]) den=i;
}
int diam=b[den],ans=diam,cnt=0,lo=1,hi=1,goal=diam/2;
for(int i=0;i<n;i++) if(i!=cen && i!=den)
{
c[i]=getDistance(den,i);
int tmp=(c[i]+diam-b[i])/2;
//tmp=max(tmp,diam-tmp);
if(abs(ans-goal)>abs(tmp-goal)) ans=tmp,cnt=0;
if(ans==tmp) cnt++;
}
for(int i=0;i<n;i++) if(i!=cen && i!=den)
{
int tmp=(c[i]+diam-b[i])/2;
if(tmp<ans) lo++;
if(tmp>ans) hi++;
}
ans=max(ans,diam-ans);
if(lo>n/2 || hi>n/2 || cnt>n/2) return -ans;
return ans;
}컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
