結果
問題 | No.2248 max(C)-min(C) |
ユーザー | tamato |
提出日時 | 2023-03-17 23:09:38 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 826 bytes |
コンパイル時間 | 211 ms |
コンパイル使用メモリ | 81,688 KB |
実行使用メモリ | 76,272 KB |
最終ジャッジ日時 | 2023-10-18 16:08:47 |
合計ジャッジ時間 | 15,113 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
63,880 KB |
testcase_01 | AC | 41 ms
59,532 KB |
testcase_02 | AC | 43 ms
59,676 KB |
testcase_03 | AC | 475 ms
75,928 KB |
testcase_04 | AC | 196 ms
75,916 KB |
testcase_05 | AC | 112 ms
75,728 KB |
testcase_06 | AC | 732 ms
76,184 KB |
testcase_07 | AC | 495 ms
76,244 KB |
testcase_08 | AC | 1,384 ms
76,228 KB |
testcase_09 | AC | 615 ms
76,208 KB |
testcase_10 | AC | 92 ms
75,744 KB |
testcase_11 | AC | 928 ms
76,232 KB |
testcase_12 | AC | 347 ms
75,936 KB |
testcase_13 | AC | 573 ms
76,168 KB |
testcase_14 | AC | 1,150 ms
76,272 KB |
testcase_15 | AC | 1,048 ms
76,212 KB |
testcase_16 | AC | 235 ms
75,920 KB |
testcase_17 | AC | 271 ms
76,208 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 | -- | - |
ソースコード
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)) for v in V: ok = 10 ** 17 ng = -1 mid = (ok + ng) // 2 while ok - ng > 1: flg = 1 for i in range(N): tmp = 0 for x in [A[i], B[i], AB[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)