結果

問題 No.412 花火大会
ユーザー 👑 rin204
提出日時 2022-11-11 15:02:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 53,944 KB
最終ジャッジ日時 2024-09-13 10:45:13
合計ジャッジ時間 2,195 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

A = list(map(int, input().split()))
A.sort()
n = int(input())
E = list(map(int, input().split()))
E.sort()
dp = [0] * 4
dp[0] = 1

for e in E:
    ndp = dp[:]
    ndp[3] *= 2
    for i in range(3):
        if e >= A[i]:
            ndp[i + 1] += dp[i]
        else:
            ndp[i] += dp[i]
    dp = ndp

print(dp[-1])
0