結果

問題 No.1998 Manhattan Restaurant
ユーザー googol_S0googol_S0
提出日時 2022-07-01 22:13:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 480 ms / 2,000 ms
コード長 727 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 97,348 KB
最終ジャッジ日時 2023-08-17 09:43:59
合計ジャッジ時間 10,106 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,300 KB
testcase_01 AC 75 ms
71,376 KB
testcase_02 AC 77 ms
71,360 KB
testcase_03 AC 76 ms
71,480 KB
testcase_04 AC 74 ms
71,388 KB
testcase_05 AC 78 ms
71,144 KB
testcase_06 AC 103 ms
76,340 KB
testcase_07 AC 115 ms
76,904 KB
testcase_08 AC 117 ms
77,152 KB
testcase_09 AC 112 ms
76,760 KB
testcase_10 AC 104 ms
76,068 KB
testcase_11 AC 97 ms
76,036 KB
testcase_12 AC 98 ms
76,272 KB
testcase_13 AC 95 ms
76,244 KB
testcase_14 AC 106 ms
76,316 KB
testcase_15 AC 445 ms
97,248 KB
testcase_16 AC 268 ms
87,668 KB
testcase_17 AC 331 ms
92,616 KB
testcase_18 AC 282 ms
87,288 KB
testcase_19 AC 291 ms
90,104 KB
testcase_20 AC 448 ms
97,348 KB
testcase_21 AC 480 ms
97,108 KB
testcase_22 AC 432 ms
96,920 KB
testcase_23 AC 452 ms
97,084 KB
testcase_24 AC 453 ms
97,180 KB
testcase_25 AC 154 ms
78,976 KB
testcase_26 AC 277 ms
89,920 KB
testcase_27 AC 233 ms
85,904 KB
testcase_28 AC 292 ms
89,684 KB
testcase_29 AC 248 ms
86,068 KB
testcase_30 AC 352 ms
94,204 KB
testcase_31 AC 343 ms
93,932 KB
testcase_32 AC 158 ms
79,492 KB
testcase_33 AC 263 ms
87,688 KB
testcase_34 AC 307 ms
90,784 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