結果

問題 No.1693 Invasion
ユーザー mahiro72
提出日時 2021-10-01 22:16:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,256 KB
最終ジャッジ日時 2024-07-19 11:36:53
合計ジャッジ時間 3,893 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 6 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import comb

N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

mod = 998244353

dp = [0]*(M+1)
dp[0]=1

for i in range(M+1):
    for a in A:
        if i-a>=0:dp[i]|=dp[i-a]

ans=1
for i in range(M+1):
    if i==0:continue
    if dp[i]==1:
        ans+=comb(M-1,i-1)%mod

print(ans%mod)
0