結果

問題 No.1238 選抜クラス
ユーザー naniwazunaniwazu
提出日時 2020-09-25 22:16:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 559 ms
コンパイル使用メモリ 86,664 KB
実行使用メモリ 77,688 KB
最終ジャッジ日時 2023-09-10 15:31:35
合計ジャッジ時間 5,698 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,060 KB
testcase_01 AC 83 ms
75,756 KB
testcase_02 AC 80 ms
75,736 KB
testcase_03 AC 77 ms
75,552 KB
testcase_04 AC 76 ms
75,660 KB
testcase_05 AC 75 ms
75,652 KB
testcase_06 AC 81 ms
75,924 KB
testcase_07 AC 83 ms
75,820 KB
testcase_08 AC 79 ms
75,884 KB
testcase_09 AC 79 ms
75,896 KB
testcase_10 AC 78 ms
75,716 KB
testcase_11 AC 79 ms
76,072 KB
testcase_12 AC 78 ms
75,732 KB
testcase_13 AC 80 ms
75,876 KB
testcase_14 AC 81 ms
75,824 KB
testcase_15 AC 78 ms
75,880 KB
testcase_16 AC 79 ms
75,880 KB
testcase_17 AC 109 ms
77,680 KB
testcase_18 AC 107 ms
77,668 KB
testcase_19 AC 106 ms
77,540 KB
testcase_20 AC 108 ms
77,400 KB
testcase_21 AC 105 ms
77,688 KB
testcase_22 AC 97 ms
76,388 KB
testcase_23 AC 102 ms
76,432 KB
testcase_24 AC 102 ms
76,212 KB
testcase_25 AC 97 ms
76,292 KB
testcase_26 AC 106 ms
77,680 KB
testcase_27 AC 109 ms
77,428 KB
testcase_28 AC 109 ms
77,440 KB
testcase_29 AC 110 ms
77,436 KB
testcase_30 AC 82 ms
75,808 KB
testcase_31 AC 83 ms
76,072 KB
testcase_32 AC 93 ms
76,676 KB
testcase_33 AC 79 ms
75,956 KB
testcase_34 AC 99 ms
76,492 KB
testcase_35 AC 85 ms
76,036 KB
testcase_36 AC 84 ms
75,996 KB
testcase_37 AC 86 ms
76,028 KB
testcase_38 AC 111 ms
77,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
N,K = map(int,input().split())
A = [x-K for x in map(int,input().split())]
dp = [0]*21000
dp[10500] = 1
for a in A:
    if a >= 0:
        for i in range(100,20900)[::-1]:
            dp[i+a] += dp[i]
    else:
        for i in range(100,20900):
            dp[i+a] += dp[i]
print((sum(dp[10500:])-1) % mod)
0