結果

問題 No.1998 Manhattan Restaurant
ユーザー HIR180HIR180
提出日時 2022-07-02 01:08:46
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 31,396 KB
実行使用メモリ 4,560 KB
最終ジャッジ日時 2023-08-17 12:55:48
合計ジャッジ時間 2,140 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 25 ms
4,528 KB
testcase_16 AC 15 ms
4,376 KB
testcase_17 AC 20 ms
4,380 KB
testcase_18 AC 15 ms
4,376 KB
testcase_19 AC 17 ms
4,380 KB
testcase_20 AC 25 ms
4,560 KB
testcase_21 AC 27 ms
4,524 KB
testcase_22 AC 27 ms
4,488 KB
testcase_23 AC 27 ms
4,524 KB
testcase_24 AC 28 ms
4,524 KB
testcase_25 AC 3 ms
4,376 KB
testcase_26 AC 16 ms
4,380 KB
testcase_27 AC 11 ms
4,384 KB
testcase_28 AC 17 ms
4,380 KB
testcase_29 AC 12 ms
4,376 KB
testcase_30 AC 23 ms
4,424 KB
testcase_31 AC 21 ms
4,376 KB
testcase_32 AC 3 ms
4,376 KB
testcase_33 AC 14 ms
4,376 KB
testcase_34 AC 18 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#define int long long
int max(int a,int b){ return a<b?b:a;}
int min(int a,int b){ return a>b?b:a;}
int n,xs=9e9,ys=9e9,xb=-9e9,yb=-9e9,ret=9e9,x[100005],y[100005],v;
signed main(){
	scanf("%lld",&n);
	for(int i=0,a,b;i<n;i++){
		scanf("%lld%lld",&a,&b);
		x[i]=a-b; y[i]=a+b;
		xs=min(xs,x[i]); xb=max(xb,x[i]);
		ys=min(ys,y[i]); yb=max(yb,y[i]);
	}
	for(int i=0;i<n;i++) v=max(v,min(max(x[i]-xs,y[i]-ys),max(xb-x[i],yb-y[i]))); ret=min(ret,v);v=0;
	for(int i=0;i<n;i++) v=max(v,min(max(x[i]-xs,yb-y[i]),max(xb-x[i],y[i]-ys)));
	ret=min(ret,v);
	printf("%lld\n",ret/2);
}
0