結果

問題 No.2561 みんな大好きmod 998
ユーザー CecilCecil
提出日時 2023-12-02 17:44:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,889 ms / 4,000 ms
コード長 335 bytes
コンパイル時間 747 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2023-12-02 17:44:37
合計ジャッジ時間 22,968 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,856 KB
testcase_01 AC 95 ms
9,856 KB
testcase_02 AC 25 ms
9,856 KB
testcase_03 AC 1,697 ms
9,856 KB
testcase_04 AC 1,735 ms
9,856 KB
testcase_05 AC 1,889 ms
9,856 KB
testcase_06 AC 1,678 ms
9,856 KB
testcase_07 AC 25 ms
9,856 KB
testcase_08 AC 25 ms
9,856 KB
testcase_09 AC 28 ms
9,856 KB
testcase_10 AC 25 ms
9,856 KB
testcase_11 AC 288 ms
9,856 KB
testcase_12 AC 26 ms
9,856 KB
testcase_13 AC 30 ms
9,856 KB
testcase_14 AC 25 ms
9,856 KB
testcase_15 AC 1,796 ms
9,856 KB
testcase_16 AC 25 ms
9,856 KB
testcase_17 AC 25 ms
9,856 KB
testcase_18 AC 27 ms
9,856 KB
testcase_19 AC 1,313 ms
9,856 KB
testcase_20 AC 26 ms
9,856 KB
testcase_21 AC 25 ms
9,856 KB
testcase_22 AC 23 ms
9,856 KB
testcase_23 AC 24 ms
9,856 KB
testcase_24 AC 24 ms
9,856 KB
testcase_25 AC 25 ms
9,856 KB
testcase_26 AC 424 ms
9,856 KB
testcase_27 AC 1,607 ms
9,856 KB
testcase_28 AC 487 ms
9,856 KB
testcase_29 AC 169 ms
9,856 KB
testcase_30 AC 416 ms
9,856 KB
testcase_31 AC 825 ms
9,856 KB
testcase_32 AC 207 ms
9,856 KB
testcase_33 AC 146 ms
9,856 KB
testcase_34 AC 1,595 ms
9,856 KB
testcase_35 AC 133 ms
9,856 KB
testcase_36 AC 136 ms
9,856 KB
testcase_37 AC 88 ms
9,856 KB
testcase_38 AC 303 ms
9,856 KB
testcase_39 AC 440 ms
9,856 KB
testcase_40 AC 476 ms
9,856 KB
testcase_41 AC 304 ms
9,856 KB
testcase_42 AC 545 ms
9,856 KB
testcase_43 AC 81 ms
9,856 KB
testcase_44 AC 239 ms
9,856 KB
testcase_45 AC 1,371 ms
9,856 KB
testcase_46 AC 201 ms
9,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
from itertools import combinations

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

product = itertools.combinations(A, K)
"""for p in product:
    print(p)"""
ans = 0
for p in product:
    #print(p)
    s = sum(p)
    if s%998244353 <= s%998:
        ans += 1
    ans %= 998
ans %= 998
print(ans)
0