結果

問題 No.412 花火大会
ユーザー 👑 rin204rin204
提出日時 2022-11-11 15:02:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 71,504 KB
最終ジャッジ日時 2023-10-11 11:58:36
合計ジャッジ時間 4,265 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,112 KB
testcase_01 AC 75 ms
71,440 KB
testcase_02 AC 76 ms
71,356 KB
testcase_03 AC 75 ms
71,112 KB
testcase_04 AC 75 ms
71,504 KB
testcase_05 AC 76 ms
71,328 KB
testcase_06 AC 75 ms
71,476 KB
testcase_07 AC 75 ms
71,156 KB
testcase_08 AC 75 ms
71,480 KB
testcase_09 AC 74 ms
71,280 KB
testcase_10 AC 74 ms
71,116 KB
testcase_11 AC 74 ms
71,424 KB
testcase_12 AC 74 ms
71,312 KB
testcase_13 AC 76 ms
71,352 KB
testcase_14 AC 75 ms
71,424 KB
testcase_15 AC 74 ms
71,412 KB
testcase_16 AC 74 ms
71,424 KB
testcase_17 AC 76 ms
71,336 KB
testcase_18 AC 74 ms
71,340 KB
testcase_19 AC 75 ms
71,344 KB
testcase_20 AC 75 ms
71,372 KB
testcase_21 AC 76 ms
71,308 KB
権限があれば一括ダウンロードができます

ソースコード

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