結果

問題 No.1238 選抜クラス
ユーザー first_vilfirst_vil
提出日時 2020-09-26 10:46:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 91,572 KB
最終ジャッジ日時 2023-09-11 06:27:43
合計ジャッジ時間 7,011 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
75,948 KB
testcase_01 AC 88 ms
76,104 KB
testcase_02 AC 94 ms
77,248 KB
testcase_03 AC 85 ms
76,004 KB
testcase_04 AC 85 ms
75,804 KB
testcase_05 AC 85 ms
76,056 KB
testcase_06 AC 83 ms
75,828 KB
testcase_07 AC 92 ms
76,748 KB
testcase_08 AC 93 ms
77,332 KB
testcase_09 AC 102 ms
78,032 KB
testcase_10 AC 94 ms
76,776 KB
testcase_11 AC 97 ms
77,704 KB
testcase_12 AC 97 ms
77,312 KB
testcase_13 AC 96 ms
77,368 KB
testcase_14 AC 93 ms
77,076 KB
testcase_15 AC 96 ms
77,972 KB
testcase_16 AC 97 ms
77,692 KB
testcase_17 AC 164 ms
91,328 KB
testcase_18 AC 163 ms
90,916 KB
testcase_19 AC 161 ms
91,172 KB
testcase_20 AC 156 ms
90,912 KB
testcase_21 AC 157 ms
90,228 KB
testcase_22 AC 158 ms
91,528 KB
testcase_23 AC 163 ms
91,468 KB
testcase_24 AC 160 ms
91,432 KB
testcase_25 AC 160 ms
91,300 KB
testcase_26 AC 163 ms
91,508 KB
testcase_27 AC 161 ms
91,572 KB
testcase_28 AC 165 ms
91,468 KB
testcase_29 AC 163 ms
91,096 KB
testcase_30 AC 111 ms
80,644 KB
testcase_31 AC 132 ms
84,300 KB
testcase_32 AC 146 ms
87,876 KB
testcase_33 AC 88 ms
76,568 KB
testcase_34 AC 158 ms
89,080 KB
testcase_35 AC 117 ms
81,648 KB
testcase_36 AC 99 ms
78,504 KB
testcase_37 AC 113 ms
80,824 KB
testcase_38 AC 160 ms
90,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  m=10**9+7
  n,k=map(int,input().split())
  a=list(map(int,input().split()))
  for i in range(n):
    a[i]-=k
  dp=[[0]*20001 for _ in range(n+1)]
  dp[0][0]=1
  for i in range(n):
    for j in range(-10000,10001):
      dp[i][j]%=m
      if -10000<=j+a[i] and j+a[i]<=10000:
        dp[i+1][j]+=dp[i][j]
        dp[i+1][j+a[i]]+=dp[i][j]
  print((sum(dp[n][:10001])-1+m)%m)
main()
0