結果

問題 No.949 飲酒プログラミングコンテスト
ユーザー ttr
提出日時 2020-01-31 17:49:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 82,604 KB
実行使用メモリ 69,240 KB
最終ジャッジ日時 2024-09-17 06:52:36
合計ジャッジ時間 2,933 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 3 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
D = [int(a) for a in input().split()]

D.sort()
c = A[0]+B[0]
i = 0
j = 0
ans = 0
while ans < N:
    if A[i+1]+B[j] > A[i]+B[j+1]:
        i += 1
    else:
        j += 1
    if A[i]+B[j] < D[0]:
        break
    ans += 1
    if A[i]+B[j] >= D[-1]:
        D.pop(-1)
        continue
    idx = bisect.bisect_left(D, A[i]+B[j])
    D.pop(idx)

print(ans)
0