結果

問題 No.2248 max(C)-min(C)
ユーザー ああいいああいい
提出日時 2023-03-18 20:19:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 780 bytes
コンパイル時間 1,283 ms
コンパイル使用メモリ 81,676 KB
実行使用メモリ 139,704 KB
最終ジャッジ日時 2023-10-18 17:29:46
合計ジャッジ時間 51,502 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,520 KB
testcase_01 AC 35 ms
53,520 KB
testcase_02 AC 35 ms
53,520 KB
testcase_03 AC 47 ms
64,068 KB
testcase_04 AC 45 ms
64,060 KB
testcase_05 AC 41 ms
59,464 KB
testcase_06 AC 56 ms
70,448 KB
testcase_07 AC 58 ms
72,496 KB
testcase_08 AC 59 ms
72,496 KB
testcase_09 AC 61 ms
72,496 KB
testcase_10 AC 42 ms
59,464 KB
testcase_11 AC 58 ms
72,496 KB
testcase_12 AC 49 ms
66,116 KB
testcase_13 AC 57 ms
68,400 KB
testcase_14 AC 59 ms
72,496 KB
testcase_15 AC 60 ms
72,496 KB
testcase_16 AC 50 ms
64,068 KB
testcase_17 AC 56 ms
72,496 KB
testcase_18 AC 1,603 ms
123,392 KB
testcase_19 AC 209 ms
82,696 KB
testcase_20 AC 1,872 ms
139,556 KB
testcase_21 AC 1,781 ms
120,144 KB
testcase_22 AC 1,195 ms
119,524 KB
testcase_23 AC 748 ms
99,172 KB
testcase_24 AC 295 ms
87,316 KB
testcase_25 AC 1,681 ms
117,176 KB
testcase_26 AC 1,494 ms
122,092 KB
testcase_27 AC 1,663 ms
117,612 KB
testcase_28 AC 169 ms
80,204 KB
testcase_29 AC 1,538 ms
124,780 KB
testcase_30 AC 591 ms
95,856 KB
testcase_31 AC 1,871 ms
139,556 KB
testcase_32 AC 336 ms
89,876 KB
testcase_33 AC 541 ms
94,340 KB
testcase_34 AC 1,894 ms
139,704 KB
testcase_35 AC 1,849 ms
139,560 KB
testcase_36 AC 1,874 ms
139,556 KB
testcase_37 AC 922 ms
109,984 KB
testcase_38 AC 1,820 ms
129,672 KB
testcase_39 AC 1,809 ms
129,672 KB
testcase_40 AC 1,827 ms
129,692 KB
testcase_41 AC 1,546 ms
131,772 KB
testcase_42 WA -
testcase_43 AC 1,604 ms
126,256 KB
testcase_44 AC 1,824 ms
129,404 KB
testcase_45 WA -
testcase_46 AC 712 ms
101,268 KB
testcase_47 WA -
testcase_48 AC 319 ms
129,940 KB
testcase_49 AC 1,744 ms
139,376 KB
testcase_50 AC 1,744 ms
139,372 KB
testcase_51 AC 1,737 ms
139,368 KB
testcase_52 AC 1,741 ms
139,372 KB
testcase_53 AC 281 ms
87,260 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