結果

問題 No.2561 みんな大好きmod 998
ユーザー toshiconnertoshiconner
提出日時 2023-12-02 15:06:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 813 ms / 4,000 ms
コード長 393 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,608 KB
最終ジャッジ日時 2023-12-02 15:06:14
合計ジャッジ時間 11,341 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,460 KB
testcase_01 AC 75 ms
75,608 KB
testcase_02 AC 32 ms
53,460 KB
testcase_03 AC 754 ms
75,608 KB
testcase_04 AC 813 ms
75,608 KB
testcase_05 AC 752 ms
75,608 KB
testcase_06 AC 809 ms
75,608 KB
testcase_07 AC 33 ms
53,460 KB
testcase_08 AC 31 ms
53,460 KB
testcase_09 AC 42 ms
66,520 KB
testcase_10 AC 31 ms
53,460 KB
testcase_11 AC 139 ms
75,580 KB
testcase_12 AC 33 ms
53,460 KB
testcase_13 AC 33 ms
53,460 KB
testcase_14 AC 32 ms
53,460 KB
testcase_15 AC 627 ms
75,608 KB
testcase_16 AC 34 ms
53,460 KB
testcase_17 AC 31 ms
53,460 KB
testcase_18 AC 39 ms
62,388 KB
testcase_19 AC 495 ms
75,608 KB
testcase_20 AC 42 ms
62,388 KB
testcase_21 AC 35 ms
53,460 KB
testcase_22 AC 32 ms
53,460 KB
testcase_23 AC 41 ms
62,388 KB
testcase_24 AC 32 ms
53,460 KB
testcase_25 AC 38 ms
53,460 KB
testcase_26 AC 184 ms
75,580 KB
testcase_27 AC 752 ms
75,608 KB
testcase_28 AC 196 ms
75,580 KB
testcase_29 AC 91 ms
75,580 KB
testcase_30 AC 242 ms
75,608 KB
testcase_31 AC 418 ms
75,608 KB
testcase_32 AC 109 ms
75,580 KB
testcase_33 AC 89 ms
75,580 KB
testcase_34 AC 797 ms
75,608 KB
testcase_35 AC 84 ms
75,580 KB
testcase_36 AC 85 ms
75,580 KB
testcase_37 AC 64 ms
75,580 KB
testcase_38 AC 130 ms
75,580 KB
testcase_39 AC 216 ms
75,608 KB
testcase_40 AC 228 ms
75,608 KB
testcase_41 AC 150 ms
75,580 KB
testcase_42 AC 194 ms
75,580 KB
testcase_43 AC 63 ms
75,580 KB
testcase_44 AC 107 ms
75,580 KB
testcase_45 AC 560 ms
75,608 KB
testcase_46 AC 97 ms
75,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

N, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

ans = 0
mod998 = 998
mod998244353 = 998244353

for comb in combinations(range(N), K):
    B = []
    for c in comb:
        B.append(A[c])
    suma = sum(B)
    s1 = suma % mod998
    s2 = suma % mod998244353
    if s1 >= s2:
        ans += 1
        ans %= mod998

print(ans)
0