結果

問題 No.1998 Manhattan Restaurant
ユーザー MasKoaTSMasKoaTS
提出日時 2022-06-23 16:31:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 1,154 bytes
コンパイル時間 751 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 100,736 KB
最終ジャッジ日時 2024-04-24 23:07:57
合計ジャッジ時間 9,655 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
86,528 KB
testcase_01 AC 141 ms
86,528 KB
testcase_02 AC 146 ms
86,272 KB
testcase_03 AC 140 ms
86,400 KB
testcase_04 AC 145 ms
86,528 KB
testcase_05 AC 140 ms
86,144 KB
testcase_06 AC 143 ms
86,400 KB
testcase_07 AC 150 ms
88,576 KB
testcase_08 AC 149 ms
88,576 KB
testcase_09 AC 149 ms
88,576 KB
testcase_10 AC 144 ms
86,400 KB
testcase_11 AC 143 ms
86,400 KB
testcase_12 AC 141 ms
86,016 KB
testcase_13 AC 142 ms
86,144 KB
testcase_14 AC 152 ms
88,448 KB
testcase_15 AC 242 ms
100,224 KB
testcase_16 AC 195 ms
94,208 KB
testcase_17 AC 213 ms
98,560 KB
testcase_18 AC 203 ms
94,080 KB
testcase_19 AC 217 ms
96,512 KB
testcase_20 AC 234 ms
100,480 KB
testcase_21 AC 230 ms
100,736 KB
testcase_22 AC 225 ms
98,688 KB
testcase_23 AC 224 ms
99,072 KB
testcase_24 AC 224 ms
98,944 KB
testcase_25 AC 163 ms
89,472 KB
testcase_26 AC 218 ms
96,128 KB
testcase_27 AC 202 ms
94,080 KB
testcase_28 AC 205 ms
94,336 KB
testcase_29 AC 194 ms
93,824 KB
testcase_30 AC 222 ms
100,096 KB
testcase_31 AC 221 ms
99,712 KB
testcase_32 AC 168 ms
89,728 KB
testcase_33 AC 209 ms
93,824 KB
testcase_34 AC 199 ms
95,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from functools import cmp_to_key
import math
import sys
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
sys.setrecursionlimit(10 ** 6)
inp = sys.stdin.readline
input = lambda : inp().rstrip()
getN = lambda : int(inp())
getNs = lambda : map(int, inp().split())
getList = lambda :list(map(int, inp().split()))
getStrs = lambda n : [input() for _ in [0] * n]
def yexit(): print("Yes"); exit(0)
def nexit(): print("No"); exit(0)
pi = 3.141592653589793
mod = 1000000007
MOD = 998244353
INF = 4611686018427387903
dx = [1, 0, -1, 0];	dy = [0, 1, 0, -1]


"""
Main Code
"""

n = getN()
house = []
for _ in [0] * n:
	x, y = getNs()
	house.append([x + y, x - y])

x_max = y_max = -INF
x_min = y_min = INF
for x, y in house:
	x_max = max(x_max, x)
	y_max = max(y_max, y)
	x_min = min(x_min, x)
	y_min = min(y_min, y)

a = b = -INF
for x, y in house:
	a = max(a, min(max(x_max - x, y_max - y), max(x - x_min, y - y_min)))
	b = max(b, min(max(x_max - x, y - y_min), max(x - x_min, y_max - y)))
ans = min(a, b) // 2
print(ans)
0