結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,556 KB
testcase_01 AC 36 ms
53,556 KB
testcase_02 AC 35 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 61 ms
72,660 KB
testcase_07 AC 70 ms
75,908 KB
testcase_08 AC 68 ms
75,912 KB
testcase_09 AC 65 ms
74,324 KB
testcase_10 AC 48 ms
61,748 KB
testcase_11 AC 69 ms
75,908 KB
testcase_12 AC 56 ms
68,480 KB
testcase_13 AC 61 ms
72,660 KB
testcase_14 AC 70 ms
75,928 KB
testcase_15 AC 70 ms
75,928 KB
testcase_16 AC 56 ms
68,480 KB
testcase_17 AC 66 ms
74,164 KB
testcase_18 AC 1,711 ms
123,516 KB
testcase_19 AC 218 ms
82,860 KB
testcase_20 AC 1,959 ms
140,220 KB
testcase_21 AC 1,863 ms
120,280 KB
testcase_22 AC 1,262 ms
119,644 KB
testcase_23 AC 781 ms
99,280 KB
testcase_24 AC 312 ms
87,436 KB
testcase_25 AC 1,763 ms
117,308 KB
testcase_26 AC 1,548 ms
122,224 KB
testcase_27 AC 1,759 ms
117,748 KB
testcase_28 AC 178 ms
80,372 KB
testcase_29 AC 1,611 ms
124,920 KB
testcase_30 AC 619 ms
95,972 KB
testcase_31 AC 1,977 ms
140,220 KB
testcase_32 AC 356 ms
89,996 KB
testcase_33 AC 573 ms
94,456 KB
testcase_34 AC 1,987 ms
140,356 KB
testcase_35 AC 1,972 ms
140,220 KB
testcase_36 AC 1,967 ms
139,688 KB
testcase_37 AC 979 ms
110,112 KB
testcase_38 AC 1,881 ms
129,800 KB
testcase_39 AC 1,891 ms
129,796 KB
testcase_40 AC 1,889 ms
129,820 KB
testcase_41 AC 1,592 ms
131,900 KB
testcase_42 WA -
testcase_43 AC 1,660 ms
126,392 KB
testcase_44 AC 1,865 ms
129,528 KB
testcase_45 WA -
testcase_46 AC 728 ms
101,384 KB
testcase_47 WA -
testcase_48 AC 330 ms
130,072 KB
testcase_49 AC 1,745 ms
139,480 KB
testcase_50 AC 1,739 ms
139,484 KB
testcase_51 AC 1,738 ms
139,476 KB
testcase_52 AC 1,767 ms
139,480 KB
testcase_53 AC 285 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 ** 11
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