結果

問題 No.2561 みんな大好きmod 998
ユーザー lloyzlloyz
提出日時 2023-12-07 00:03:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 669 ms / 4,000 ms
コード長 420 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,416 KB
最終ジャッジ日時 2023-12-07 00:03:48
合計ジャッジ時間 11,381 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
53,588 KB
testcase_01 AC 74 ms
75,416 KB
testcase_02 AC 38 ms
53,588 KB
testcase_03 AC 648 ms
75,416 KB
testcase_04 AC 652 ms
75,416 KB
testcase_05 AC 646 ms
75,416 KB
testcase_06 AC 650 ms
75,416 KB
testcase_07 AC 36 ms
53,588 KB
testcase_08 AC 36 ms
53,588 KB
testcase_09 AC 42 ms
60,108 KB
testcase_10 AC 35 ms
53,588 KB
testcase_11 AC 104 ms
75,412 KB
testcase_12 AC 36 ms
53,588 KB
testcase_13 AC 36 ms
53,588 KB
testcase_14 AC 36 ms
53,588 KB
testcase_15 AC 464 ms
75,416 KB
testcase_16 AC 36 ms
53,588 KB
testcase_17 AC 35 ms
53,588 KB
testcase_18 AC 41 ms
60,116 KB
testcase_19 AC 408 ms
75,416 KB
testcase_20 AC 41 ms
60,112 KB
testcase_21 AC 36 ms
53,588 KB
testcase_22 AC 35 ms
53,588 KB
testcase_23 AC 42 ms
60,116 KB
testcase_24 AC 35 ms
53,588 KB
testcase_25 AC 36 ms
53,588 KB
testcase_26 AC 127 ms
75,412 KB
testcase_27 AC 649 ms
75,416 KB
testcase_28 AC 152 ms
75,412 KB
testcase_29 AC 77 ms
75,412 KB
testcase_30 AC 195 ms
75,416 KB
testcase_31 AC 353 ms
75,416 KB
testcase_32 AC 90 ms
75,412 KB
testcase_33 AC 76 ms
75,412 KB
testcase_34 AC 669 ms
75,416 KB
testcase_35 AC 72 ms
75,412 KB
testcase_36 AC 73 ms
75,412 KB
testcase_37 AC 54 ms
72,468 KB
testcase_38 AC 104 ms
75,412 KB
testcase_39 AC 190 ms
75,416 KB
testcase_40 AC 191 ms
75,416 KB
testcase_41 AC 105 ms
75,412 KB
testcase_42 AC 153 ms
75,412 KB
testcase_43 AC 55 ms
72,468 KB
testcase_44 AC 90 ms
75,412 KB
testcase_45 AC 476 ms
75,416 KB
testcase_46 AC 80 ms
75,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
A = list(map(int, input().split()))

ans = 0
mod1 = 998
mod2 = 998244353
for C in combinations(range(n), k):
    res1, res2 = 0, 0
    for i in range(k):
        res1 += A[C[i]]
        res1 %= mod1
        res2 += A[C[i]]
        res2 %= mod2
    if res2 <= res1:
        ans += 1
        ans %= mod1
print(ans)
0