結果

問題 No.2561 みんな大好きmod 998
ユーザー AngrySadEightAngrySadEight
提出日時 2023-11-24 00:24:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,500 ms / 4,000 ms
コード長 438 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2023-11-24 00:24:56
合計ジャッジ時間 41,062 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,856 KB
testcase_01 AC 171 ms
9,856 KB
testcase_02 AC 29 ms
9,856 KB
testcase_03 AC 2,891 ms
9,856 KB
testcase_04 AC 3,097 ms
9,856 KB
testcase_05 AC 3,500 ms
9,856 KB
testcase_06 AC 3,053 ms
9,856 KB
testcase_07 AC 29 ms
9,856 KB
testcase_08 AC 28 ms
9,856 KB
testcase_09 AC 34 ms
9,856 KB
testcase_10 AC 29 ms
9,856 KB
testcase_11 AC 512 ms
9,856 KB
testcase_12 AC 29 ms
9,856 KB
testcase_13 AC 28 ms
9,856 KB
testcase_14 AC 29 ms
9,856 KB
testcase_15 AC 3,439 ms
9,856 KB
testcase_16 AC 28 ms
9,856 KB
testcase_17 AC 28 ms
9,856 KB
testcase_18 AC 29 ms
9,856 KB
testcase_19 AC 2,506 ms
9,856 KB
testcase_20 AC 30 ms
9,856 KB
testcase_21 AC 28 ms
9,856 KB
testcase_22 AC 29 ms
9,856 KB
testcase_23 AC 30 ms
9,856 KB
testcase_24 AC 29 ms
9,856 KB
testcase_25 AC 29 ms
9,856 KB
testcase_26 AC 690 ms
9,856 KB
testcase_27 AC 3,084 ms
9,856 KB
testcase_28 AC 811 ms
9,856 KB
testcase_29 AC 278 ms
9,856 KB
testcase_30 AC 794 ms
9,856 KB
testcase_31 AC 1,602 ms
9,856 KB
testcase_32 AC 328 ms
9,856 KB
testcase_33 AC 260 ms
9,856 KB
testcase_34 AC 3,079 ms
9,856 KB
testcase_35 AC 217 ms
9,856 KB
testcase_36 AC 215 ms
9,856 KB
testcase_37 AC 124 ms
9,856 KB
testcase_38 AC 538 ms
9,856 KB
testcase_39 AC 909 ms
9,856 KB
testcase_40 AC 889 ms
9,856 KB
testcase_41 AC 521 ms
9,856 KB
testcase_42 AC 924 ms
9,856 KB
testcase_43 AC 125 ms
9,856 KB
testcase_44 AC 395 ms
9,856 KB
testcase_45 AC 2,535 ms
9,856 KB
testcase_46 AC 299 ms
9,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
lst = [-1]


def dfs(lst):
    global ans
    if len(lst) == K + 1:
        # print(lst[1:])
        S = 0
        for x in lst[1:]:
            S += A[x]
        if S % 998244353 <= S % 998:
            ans += 1
    else:
        for i in range(lst[-1] + 1, N):
            lst.append(i)
            dfs(lst)
            lst.pop()


dfs(lst)
print(ans % 998)
0