結果

問題 No.949 飲酒プログラミングコンテスト
ユーザー neterukunneterukun
提出日時 2019-12-21 10:56:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 76,820 KB
最終ジャッジ日時 2023-09-26 09:03:49
合計ジャッジ時間 5,262 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,468 KB
testcase_01 AC 69 ms
71,536 KB
testcase_02 AC 70 ms
71,388 KB
testcase_03 AC 70 ms
71,528 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 71 ms
71,520 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 71 ms
71,204 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 75 ms
75,700 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 75 ms
75,728 KB
testcase_18 AC 78 ms
76,388 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 71 ms
71,036 KB
testcase_24 AC 80 ms
76,532 KB
testcase_25 WA -
testcase_26 AC 75 ms
76,312 KB
testcase_27 WA -
testcase_28 AC 79 ms
76,604 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 80 ms
76,592 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = list(map(int, input().split()))
d = sorted(d, reverse = True)

ia = 0
ib = 0
i = 0
ans = 0
for _ in range(n):
    diff_a = a[ia] - a[ia + 1]
    diff_b = b[ib] - b[ib + 1]
    if diff_a < diff_b:
        ia += 1
    else:
        ib += 1
    sum_ = a[ia] + b[ib]
    while i < n:
        if d[i] <= sum_:
            ans += 1
            i += 1
            break
        else:
            i += 1
print(ans)
0