結果

問題 No.1238 選抜クラス
ユーザー hir355hir355
提出日時 2020-09-25 21:49:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 86,516 KB
実行使用メモリ 91,832 KB
最終ジャッジ日時 2023-09-10 15:12:33
合計ジャッジ時間 6,204 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
76,328 KB
testcase_01 AC 81 ms
76,480 KB
testcase_02 AC 87 ms
77,448 KB
testcase_03 AC 80 ms
76,256 KB
testcase_04 AC 76 ms
76,248 KB
testcase_05 AC 79 ms
76,176 KB
testcase_06 AC 78 ms
76,240 KB
testcase_07 AC 83 ms
76,768 KB
testcase_08 AC 86 ms
77,424 KB
testcase_09 AC 91 ms
78,200 KB
testcase_10 AC 87 ms
77,164 KB
testcase_11 AC 88 ms
78,092 KB
testcase_12 AC 85 ms
77,680 KB
testcase_13 AC 86 ms
77,608 KB
testcase_14 AC 87 ms
77,460 KB
testcase_15 AC 89 ms
78,328 KB
testcase_16 AC 88 ms
78,044 KB
testcase_17 AC 146 ms
91,832 KB
testcase_18 AC 148 ms
91,224 KB
testcase_19 AC 146 ms
91,336 KB
testcase_20 AC 141 ms
91,132 KB
testcase_21 AC 143 ms
90,400 KB
testcase_22 AC 147 ms
91,624 KB
testcase_23 AC 147 ms
91,576 KB
testcase_24 AC 150 ms
91,708 KB
testcase_25 AC 147 ms
91,680 KB
testcase_26 AC 146 ms
91,776 KB
testcase_27 AC 148 ms
91,588 KB
testcase_28 AC 149 ms
91,664 KB
testcase_29 AC 148 ms
91,288 KB
testcase_30 AC 100 ms
80,840 KB
testcase_31 AC 116 ms
84,436 KB
testcase_32 AC 132 ms
88,084 KB
testcase_33 AC 85 ms
77,076 KB
testcase_34 AC 137 ms
89,344 KB
testcase_35 AC 106 ms
81,956 KB
testcase_36 AC 94 ms
78,976 KB
testcase_37 AC 105 ms
81,024 KB
testcase_38 AC 148 ms
90,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n, k = map(int, input().split())
a = list(map(lambda x: int(x)-k, input().split()))
dp = [[0]*20010 for _ in range(n + 1)]
dp[0][0] = 1
for i in range(n):
    for j in range(len(dp[i])):
        dp[i + 1][j] += dp[i][j] % MOD
        dp[i + 1][(j + a[i]) % len(dp[i])] += dp[i][j] % MOD
ans = -1
for i in range(10001):
    ans += dp[n][i]
print(ans % MOD)
0