結果

問題 No.2561 みんな大好きmod 998
ユーザー loop0919loop0919
提出日時 2023-10-26 23:11:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 313 ms / 4,000 ms
コード長 363 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 81,872 KB
実行使用メモリ 76,852 KB
最終ジャッジ日時 2023-11-05 13:19:35
合計ジャッジ時間 6,979 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,620 KB
testcase_01 AC 107 ms
76,084 KB
testcase_02 AC 37 ms
53,620 KB
testcase_03 AC 284 ms
76,556 KB
testcase_04 AC 279 ms
76,496 KB
testcase_05 AC 273 ms
76,492 KB
testcase_06 AC 280 ms
76,432 KB
testcase_07 AC 36 ms
53,620 KB
testcase_08 AC 35 ms
53,620 KB
testcase_09 AC 54 ms
68,512 KB
testcase_10 AC 35 ms
53,620 KB
testcase_11 AC 115 ms
75,828 KB
testcase_12 AC 36 ms
53,620 KB
testcase_13 AC 36 ms
53,620 KB
testcase_14 AC 36 ms
53,620 KB
testcase_15 AC 313 ms
76,488 KB
testcase_16 AC 35 ms
53,620 KB
testcase_17 AC 35 ms
53,620 KB
testcase_18 AC 37 ms
53,620 KB
testcase_19 AC 265 ms
76,844 KB
testcase_20 AC 40 ms
59,840 KB
testcase_21 AC 36 ms
53,620 KB
testcase_22 AC 35 ms
53,620 KB
testcase_23 AC 37 ms
53,620 KB
testcase_24 AC 35 ms
53,620 KB
testcase_25 AC 35 ms
53,620 KB
testcase_26 AC 126 ms
76,328 KB
testcase_27 AC 278 ms
76,496 KB
testcase_28 AC 139 ms
76,068 KB
testcase_29 AC 96 ms
76,244 KB
testcase_30 AC 149 ms
76,380 KB
testcase_31 AC 199 ms
76,352 KB
testcase_32 AC 92 ms
75,912 KB
testcase_33 AC 97 ms
76,244 KB
testcase_34 AC 291 ms
76,488 KB
testcase_35 AC 87 ms
75,912 KB
testcase_36 AC 86 ms
75,912 KB
testcase_37 AC 75 ms
75,888 KB
testcase_38 AC 118 ms
75,828 KB
testcase_39 AC 153 ms
76,384 KB
testcase_40 AC 153 ms
76,380 KB
testcase_41 AC 108 ms
75,828 KB
testcase_42 AC 131 ms
76,068 KB
testcase_43 AC 74 ms
75,888 KB
testcase_44 AC 103 ms
76,148 KB
testcase_45 AC 240 ms
76,852 KB
testcase_46 AC 90 ms
75,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
M1 = 998244353
M2 = 998
ans = 0

def f(B, idx, S):
    if len(B) == K:
        if S%M1 <= S%M2:
            return 1
        return 0
    ans = 0
    for i in range(idx, N):
        B.append(A[i])
        ans += f(B, i+1, S+A[i])
        B.pop()
    return ans

B = []


print(f(B, 0, 0) % 998)
0