結果

問題 No.1682 Unfair Game
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-17 22:06:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 111,832 KB
最終ジャッジ日時 2023-09-12 07:45:45
合計ジャッジ時間 6,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,792 KB
testcase_01 AC 94 ms
71,904 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 305 ms
86,644 KB
testcase_08 WA -
testcase_09 AC 114 ms
78,092 KB
testcase_10 WA -
testcase_11 AC 119 ms
77,892 KB
testcase_12 AC 105 ms
77,788 KB
testcase_13 WA -
testcase_14 AC 95 ms
71,648 KB
testcase_15 AC 94 ms
71,896 KB
testcase_16 AC 95 ms
72,004 KB
testcase_17 AC 97 ms
71,964 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 259 ms
86,744 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())
P = list(map(int, input().split()))
mod = 10 ** 9 + 7

# dp[i, j]: i枚コインを投げて、表の期待値がj -> 何通りか
dp = [defaultdict(int) for _ in range(N + 1)]
dp[0][0] = 1
for i, p in enumerate(P, 1):
    for j in range(i)[::-1]:
        for k, v in dp[j].items():
            dp[j + 1][k + p] += v
            dp[j + 1][k + p] %= mod

ans = 0
for i in range(1, N+1):
    for k, v in dp[i].items():
        if 2 * k > 100 * i:
            ans = (ans + v) % mod

print(ans)
0