結果

問題 No.2561 みんな大好きmod 998
ユーザー 👑 KazunKazun
提出日時 2024-01-21 00:55:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,230 ms / 4,000 ms
コード長 407 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 75,784 KB
最終ジャッジ日時 2024-01-21 00:55:48
合計ジャッジ時間 17,658 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 108 ms
75,784 KB
testcase_02 AC 50 ms
53,460 KB
testcase_03 AC 1,219 ms
75,784 KB
testcase_04 AC 1,208 ms
75,784 KB
testcase_05 AC 1,207 ms
75,784 KB
testcase_06 AC 1,138 ms
75,784 KB
testcase_07 AC 40 ms
53,460 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 59 ms
70,648 KB
testcase_10 AC 38 ms
53,460 KB
testcase_11 AC 221 ms
75,648 KB
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 38 ms
53,460 KB
testcase_14 AC 37 ms
53,460 KB
testcase_15 AC 1,230 ms
75,784 KB
testcase_16 AC 38 ms
53,460 KB
testcase_17 AC 36 ms
53,460 KB
testcase_18 AC 46 ms
61,600 KB
testcase_19 AC 865 ms
75,784 KB
testcase_20 AC 51 ms
64,448 KB
testcase_21 AC 35 ms
53,460 KB
testcase_22 AC 36 ms
53,460 KB
testcase_23 AC 45 ms
61,600 KB
testcase_24 AC 36 ms
53,460 KB
testcase_25 AC 35 ms
53,460 KB
testcase_26 AC 272 ms
75,648 KB
testcase_27 AC 1,203 ms
75,784 KB
testcase_28 AC 343 ms
75,648 KB
testcase_29 AC 137 ms
75,648 KB
testcase_30 AC 331 ms
75,784 KB
testcase_31 AC 625 ms
75,784 KB
testcase_32 AC 172 ms
75,648 KB
testcase_33 AC 138 ms
75,648 KB
testcase_34 AC 1,199 ms
75,784 KB
testcase_35 AC 128 ms
75,648 KB
testcase_36 AC 129 ms
75,648 KB
testcase_37 AC 89 ms
75,648 KB
testcase_38 AC 217 ms
75,648 KB
testcase_39 AC 345 ms
75,784 KB
testcase_40 AC 322 ms
75,784 KB
testcase_41 AC 210 ms
75,648 KB
testcase_42 AC 348 ms
75,648 KB
testcase_43 AC 88 ms
75,648 KB
testcase_44 AC 169 ms
75,648 KB
testcase_45 AC 854 ms
75,784 KB
testcase_46 AC 153 ms
75,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    from itertools import combinations

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

    Mod1 = 998; Mod2 = 998244353
    ans = 0
    for x in combinations(range(N), r = K):
        S = sum(A[x[i]] for i in range(K))
        if S % Mod2 <= S % Mod1:
            ans += 1
    return ans % Mod1

#==================================================
print(solve())
0