結果

問題 No.2248 max(C)-min(C)
ユーザー ああいいああいい
提出日時 2023-03-18 20:21:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 796 bytes
コンパイル時間 850 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 140,356 KB
最終ジャッジ日時 2023-10-18 17:30:59
合計ジャッジ時間 54,110 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,556 KB
testcase_01 AC 36 ms
53,556 KB
testcase_02 AC 36 ms
53,556 KB
testcase_03 AC 54 ms
68,480 KB
testcase_04 AC 52 ms
66,404 KB
testcase_05 AC 46 ms
61,748 KB
testcase_06 AC 62 ms
72,660 KB
testcase_07 AC 68 ms
75,908 KB
testcase_08 AC 69 ms
75,908 KB
testcase_09 AC 65 ms
74,340 KB
testcase_10 AC 46 ms
61,748 KB
testcase_11 AC 68 ms
75,908 KB
testcase_12 AC 55 ms
68,480 KB
testcase_13 AC 60 ms
72,660 KB
testcase_14 AC 70 ms
75,928 KB
testcase_15 AC 71 ms
75,928 KB
testcase_16 AC 55 ms
68,480 KB
testcase_17 AC 65 ms
74,160 KB
testcase_18 AC 1,702 ms
123,516 KB
testcase_19 AC 219 ms
82,860 KB
testcase_20 AC 1,988 ms
140,220 KB
testcase_21 AC 1,863 ms
120,280 KB
testcase_22 AC 1,253 ms
119,644 KB
testcase_23 AC 778 ms
99,284 KB
testcase_24 AC 306 ms
87,436 KB
testcase_25 AC 1,767 ms
117,308 KB
testcase_26 AC 1,556 ms
122,232 KB
testcase_27 AC 1,737 ms
117,748 KB
testcase_28 AC 181 ms
80,372 KB
testcase_29 AC 1,608 ms
124,436 KB
testcase_30 AC 618 ms
95,972 KB
testcase_31 AC 1,980 ms
140,220 KB
testcase_32 AC 354 ms
89,996 KB
testcase_33 AC 569 ms
94,456 KB
testcase_34 AC 1,968 ms
140,356 KB
testcase_35 AC 1,982 ms
140,220 KB
testcase_36 AC 1,984 ms
140,216 KB
testcase_37 AC 977 ms
110,112 KB
testcase_38 AC 1,892 ms
129,804 KB
testcase_39 AC 1,867 ms
129,796 KB
testcase_40 AC 1,880 ms
129,828 KB
testcase_41 AC 1,577 ms
131,900 KB
testcase_42 WA -
testcase_43 AC 1,631 ms
126,388 KB
testcase_44 AC 1,893 ms
129,532 KB
testcase_45 WA -
testcase_46 AC 730 ms
101,384 KB
testcase_47 WA -
testcase_48 AC 328 ms
130,072 KB
testcase_49 AC 1,754 ms
139,484 KB
testcase_50 AC 1,765 ms
139,480 KB
testcase_51 AC 1,766 ms
139,412 KB
testcase_52 AC 1,746 ms
139,480 KB
testcase_53 AC 284 ms
87,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

l = [(A[i],i) for i in range(N)] + [(B[i],i) for i in range(N)] + [(A[i] // 2 + B[i] // 2,i) for i in range(N)]
l.sort()

now = l[0][0]
ii = l[0][1]

ans = 10 ** 10
inf = 10 ** 10
t = 0
for i in range(N):
    a = A[i]
    b = B[i]
    c = (a + b) // 2
    k = inf
    for u in (a,b,c):
        if u >= now and u < k:
            k = u
    if k > t:
        t = k
ans = t - now
for n,jj in l[1:]:
    a = A[ii]
    b = B[ii]
    c = (a + b) // 2
    k = inf
    for u in (a,b,c):
        if u >= n and u < k:
            k = u
    """
    if k == inf:
        print(ans)
        exit()
    """
    if k > t:
        t = k
    if t - n < ans:
        ans = t - n
    now = n
    ii = jj
print(ans)
0