結果

問題 No.2248 max(C)-min(C)
ユーザー tamatotamato
提出日時 2023-03-17 23:10:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 861 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 76,272 KB
最終ジャッジ日時 2023-10-18 16:09:40
合計ジャッジ時間 10,243 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,348 KB
testcase_01 AC 39 ms
53,348 KB
testcase_02 AC 44 ms
59,316 KB
testcase_03 AC 180 ms
75,720 KB
testcase_04 AC 106 ms
75,676 KB
testcase_05 AC 79 ms
75,480 KB
testcase_06 AC 318 ms
76,172 KB
testcase_07 AC 199 ms
76,272 KB
testcase_08 AC 440 ms
76,220 KB
testcase_09 AC 232 ms
76,264 KB
testcase_10 AC 77 ms
75,480 KB
testcase_11 AC 311 ms
76,220 KB
testcase_12 AC 148 ms
75,732 KB
testcase_13 AC 202 ms
76,084 KB
testcase_14 AC 387 ms
76,220 KB
testcase_15 AC 342 ms
76,220 KB
testcase_16 AC 112 ms
75,708 KB
testcase_17 AC 132 ms
76,204 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
mod = 998244353

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
AB = [(a + b) // 2 for a, b in zip(A, B)]

V = set()
for a in A:
    V.add(a)
for b in B:
    V.add(b)
for ab in AB:
    V.add(ab)
V = sorted(list(V))
ans = 10 ** 17
mi = min(min(A), min(B))
ma = max(max(A), max(B))
X = [(a, b, ab) for a, b, ab in zip(A, B, AB)]
for v in V:
    ok = 10 ** 9 + 1
    ng = -1
    mid = (ok + ng) // 2
    while ok - ng > 1:
        flg = 1
        for i in range(N):
            tmp = 0
            for x in X[i]:
                if v <= x <= v + mid:
                    tmp = 1
            if not tmp:
                flg = 0
                break
        if flg:
            ok = mid
        else:
            ng = mid
        mid = (ok + ng) // 2
    ans = min(ans, ok)
print(ans)
0