結果

問題 No.2561 みんな大好きmod 998
ユーザー けんぴんけんぴん
提出日時 2023-10-29 18:52:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 490 ms / 4,000 ms
コード長 438 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 81,880 KB
実行使用メモリ 75,500 KB
最終ジャッジ日時 2023-11-05 13:19:44
合計ジャッジ時間 8,834 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,676 KB
testcase_01 AC 68 ms
75,472 KB
testcase_02 AC 36 ms
53,676 KB
testcase_03 AC 478 ms
75,500 KB
testcase_04 AC 474 ms
75,500 KB
testcase_05 AC 467 ms
75,500 KB
testcase_06 AC 472 ms
75,500 KB
testcase_07 AC 38 ms
53,676 KB
testcase_08 AC 37 ms
53,676 KB
testcase_09 AC 48 ms
66,324 KB
testcase_10 AC 37 ms
53,676 KB
testcase_11 AC 117 ms
75,468 KB
testcase_12 AC 36 ms
53,676 KB
testcase_13 AC 37 ms
53,676 KB
testcase_14 AC 37 ms
53,676 KB
testcase_15 AC 477 ms
75,500 KB
testcase_16 AC 37 ms
53,676 KB
testcase_17 AC 37 ms
53,676 KB
testcase_18 AC 42 ms
59,192 KB
testcase_19 AC 357 ms
75,492 KB
testcase_20 AC 45 ms
62,216 KB
testcase_21 AC 36 ms
53,676 KB
testcase_22 AC 36 ms
53,676 KB
testcase_23 AC 40 ms
59,192 KB
testcase_24 AC 36 ms
53,676 KB
testcase_25 AC 36 ms
53,676 KB
testcase_26 AC 140 ms
75,476 KB
testcase_27 AC 476 ms
75,500 KB
testcase_28 AC 173 ms
75,476 KB
testcase_29 AC 85 ms
75,468 KB
testcase_30 AC 157 ms
75,476 KB
testcase_31 AC 277 ms
75,492 KB
testcase_32 AC 101 ms
75,468 KB
testcase_33 AC 85 ms
75,468 KB
testcase_34 AC 490 ms
75,500 KB
testcase_35 AC 82 ms
75,476 KB
testcase_36 AC 82 ms
75,476 KB
testcase_37 AC 64 ms
75,468 KB
testcase_38 AC 117 ms
75,468 KB
testcase_39 AC 158 ms
75,476 KB
testcase_40 AC 157 ms
75,476 KB
testcase_41 AC 119 ms
75,472 KB
testcase_42 AC 175 ms
75,472 KB
testcase_43 AC 64 ms
75,468 KB
testcase_44 AC 101 ms
75,468 KB
testcase_45 AC 361 ms
75,492 KB
testcase_46 AC 91 ms
75,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

def main():
    N,K = map(int,input().split())
    assert 1 <= N <= 35
    assert 1 <= K <= min(8,N)
    A = list(map(int,input().split()))
    for a in A:
        assert 0 <= a <= 998244352
    ans = 0
    for comb in combinations(A,K):
        sum_comb = sum(comb)
        if sum_comb % 998244353 <= sum_comb % 998:
            ans += 1
    print(ans % 998)
    
if __name__ == "__main__":
    main()
0