結果

問題 No.2561 みんな大好きmod 998
ユーザー ThetaTheta
提出日時 2023-12-15 15:46:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,199 ms / 4,000 ms
コード長 342 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2023-12-15 15:47:15
合計ジャッジ時間 38,333 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,984 KB
testcase_01 AC 150 ms
9,984 KB
testcase_02 AC 27 ms
9,984 KB
testcase_03 AC 3,052 ms
9,984 KB
testcase_04 AC 3,026 ms
9,984 KB
testcase_05 AC 3,199 ms
9,984 KB
testcase_06 AC 3,058 ms
9,984 KB
testcase_07 AC 28 ms
9,984 KB
testcase_08 AC 27 ms
9,984 KB
testcase_09 AC 32 ms
9,984 KB
testcase_10 AC 27 ms
9,984 KB
testcase_11 AC 479 ms
9,984 KB
testcase_12 AC 28 ms
9,984 KB
testcase_13 AC 28 ms
9,984 KB
testcase_14 AC 27 ms
9,984 KB
testcase_15 AC 3,194 ms
9,984 KB
testcase_16 AC 27 ms
9,984 KB
testcase_17 AC 26 ms
9,984 KB
testcase_18 AC 27 ms
9,984 KB
testcase_19 AC 2,279 ms
9,984 KB
testcase_20 AC 29 ms
9,984 KB
testcase_21 AC 28 ms
9,984 KB
testcase_22 AC 26 ms
9,984 KB
testcase_23 AC 27 ms
9,984 KB
testcase_24 AC 26 ms
9,984 KB
testcase_25 AC 27 ms
9,984 KB
testcase_26 AC 654 ms
9,984 KB
testcase_27 AC 3,010 ms
9,984 KB
testcase_28 AC 852 ms
9,984 KB
testcase_29 AC 249 ms
9,984 KB
testcase_30 AC 731 ms
9,984 KB
testcase_31 AC 1,520 ms
9,984 KB
testcase_32 AC 346 ms
9,984 KB
testcase_33 AC 248 ms
9,984 KB
testcase_34 AC 2,988 ms
9,984 KB
testcase_35 AC 224 ms
9,984 KB
testcase_36 AC 224 ms
9,984 KB
testcase_37 AC 119 ms
9,984 KB
testcase_38 AC 486 ms
9,984 KB
testcase_39 AC 769 ms
9,984 KB
testcase_40 AC 761 ms
9,984 KB
testcase_41 AC 486 ms
9,984 KB
testcase_42 AC 883 ms
9,984 KB
testcase_43 AC 119 ms
9,984 KB
testcase_44 AC 354 ms
9,984 KB
testcase_45 AC 2,271 ms
9,984 KB
testcase_46 AC 290 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    ctr = 0
    for idxs in combinations(range(N), r=K):
        S = sum(A[idx] for idx in idxs)
        if S % 998 >= S % 998244353:
            ctr += 1
    print(ctr % 998)


if __name__ == "__main__":
    main()
0