結果

問題 No.1238 選抜クラス
ユーザー first_vilfirst_vil
提出日時 2020-09-26 10:27:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 1,424 ms
コンパイル使用メモリ 86,408 KB
実行使用メモリ 91,660 KB
最終ジャッジ日時 2023-09-11 06:02:50
合計ジャッジ時間 7,720 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
76,052 KB
testcase_01 AC 84 ms
76,120 KB
testcase_02 AC 89 ms
77,308 KB
testcase_03 AC 83 ms
75,972 KB
testcase_04 AC 80 ms
76,292 KB
testcase_05 AC 80 ms
75,972 KB
testcase_06 AC 81 ms
76,136 KB
testcase_07 AC 86 ms
76,712 KB
testcase_08 AC 89 ms
77,100 KB
testcase_09 AC 95 ms
78,060 KB
testcase_10 AC 89 ms
77,000 KB
testcase_11 AC 93 ms
77,620 KB
testcase_12 AC 89 ms
77,372 KB
testcase_13 AC 91 ms
77,448 KB
testcase_14 AC 87 ms
77,196 KB
testcase_15 AC 93 ms
77,940 KB
testcase_16 AC 93 ms
77,920 KB
testcase_17 AC 159 ms
91,228 KB
testcase_18 AC 160 ms
90,980 KB
testcase_19 AC 156 ms
91,164 KB
testcase_20 AC 155 ms
90,764 KB
testcase_21 AC 152 ms
90,140 KB
testcase_22 AC 156 ms
91,292 KB
testcase_23 AC 159 ms
91,548 KB
testcase_24 WA -
testcase_25 AC 155 ms
91,440 KB
testcase_26 AC 161 ms
91,316 KB
testcase_27 AC 160 ms
91,548 KB
testcase_28 AC 162 ms
91,572 KB
testcase_29 AC 160 ms
91,256 KB
testcase_30 AC 108 ms
80,616 KB
testcase_31 AC 131 ms
84,404 KB
testcase_32 AC 142 ms
87,844 KB
testcase_33 AC 86 ms
76,884 KB
testcase_34 AC 151 ms
89,052 KB
testcase_35 AC 115 ms
81,752 KB
testcase_36 AC 99 ms
78,656 KB
testcase_37 AC 109 ms
80,896 KB
testcase_38 AC 156 ms
90,928 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][:10000])-1+m)%m)
main()
0