結果

問題 No.1693 Invasion
ユーザー mahiro72mahiro72
提出日時 2021-10-01 22:16:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 13,340 KB
最終ジャッジ日時 2023-09-26 17:40:04
合計ジャッジ時間 4,017 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
12,220 KB
testcase_01 AC 18 ms
7,924 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

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