結果

問題 No.1998 Manhattan Restaurant
ユーザー googol_S0googol_S0
提出日時 2022-07-01 22:13:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 727 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 96,228 KB
最終ジャッジ日時 2024-05-04 16:34:51
合計ジャッジ時間 7,062 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,480 KB
testcase_01 AC 41 ms
52,736 KB
testcase_02 AC 36 ms
52,096 KB
testcase_03 AC 39 ms
52,736 KB
testcase_04 AC 38 ms
52,096 KB
testcase_05 AC 37 ms
52,480 KB
testcase_06 AC 58 ms
68,480 KB
testcase_07 AC 70 ms
73,472 KB
testcase_08 AC 71 ms
74,240 KB
testcase_09 AC 66 ms
71,552 KB
testcase_10 AC 59 ms
69,376 KB
testcase_11 AC 52 ms
65,280 KB
testcase_12 AC 54 ms
65,408 KB
testcase_13 AC 52 ms
64,768 KB
testcase_14 AC 69 ms
69,760 KB
testcase_15 AC 372 ms
96,228 KB
testcase_16 AC 204 ms
86,784 KB
testcase_17 AC 243 ms
88,956 KB
testcase_18 AC 216 ms
86,528 KB
testcase_19 AC 221 ms
88,576 KB
testcase_20 AC 348 ms
96,128 KB
testcase_21 AC 379 ms
96,128 KB
testcase_22 AC 337 ms
96,000 KB
testcase_23 AC 357 ms
95,872 KB
testcase_24 AC 356 ms
96,000 KB
testcase_25 AC 112 ms
77,984 KB
testcase_26 AC 214 ms
88,448 KB
testcase_27 AC 168 ms
82,688 KB
testcase_28 AC 222 ms
88,764 KB
testcase_29 AC 179 ms
82,048 KB
testcase_30 AC 277 ms
93,696 KB
testcase_31 AC 268 ms
92,064 KB
testcase_32 AC 109 ms
77,824 KB
testcase_33 AC 199 ms
86,584 KB
testcase_34 AC 237 ms
88,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
X=[list(map(int,input().split())) for i in range(N)]
for i in range(N):
  X[i]=[X[i][0]+X[i][1],X[i][0]-X[i][1]]
L,R=0,10**13
while L<R:
  M=(L+R)>>1
  l1,l2,r1,r2=X[0][0],X[0][1],X[0][0],X[0][1]
  for i in range(N):
    l1=min(l1,X[i][0])
    l2=min(l2,X[i][1])
    r1=max(r1,X[i][0])
    r2=max(r2,X[i][1])
  C=0
  for i in range(N):
    if abs(l1-X[i][0])<=2*M and abs(l2-X[i][1])<=2*M:
      C+=1
    elif abs(r1-X[i][0])<=2*M and abs(r2-X[i][1])<=2*M:
      C+=1
  if C==N:
    R=M
    continue
  C=0
  for i in range(N):
    if abs(l1-X[i][0])<=2*M and abs(r2-X[i][1])<=2*M:
      C+=1
    elif abs(r1-X[i][0])<=2*M and abs(l2-X[i][1])<=2*M:
      C+=1
  if C==N:
    R=M
  else:
    L=max(L+1,M)
print(L)
0