結果

問題 No.2561 みんな大好きmod 998
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-12-02 15:55:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,663 ms / 4,000 ms
コード長 403 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 486,020 KB
最終ジャッジ日時 2023-12-02 15:55:40
合計ジャッジ時間 19,342 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,460 KB
testcase_01 AC 90 ms
96,112 KB
testcase_02 AC 34 ms
53,460 KB
testcase_03 AC 1,603 ms
486,016 KB
testcase_04 AC 1,663 ms
486,012 KB
testcase_05 AC 1,570 ms
486,020 KB
testcase_06 AC 1,580 ms
486,016 KB
testcase_07 AC 34 ms
53,460 KB
testcase_08 AC 32 ms
53,460 KB
testcase_09 AC 40 ms
62,124 KB
testcase_10 AC 33 ms
53,460 KB
testcase_11 AC 183 ms
137,024 KB
testcase_12 AC 34 ms
53,460 KB
testcase_13 AC 35 ms
53,460 KB
testcase_14 AC 33 ms
53,460 KB
testcase_15 AC 1,418 ms
486,012 KB
testcase_16 AC 32 ms
53,460 KB
testcase_17 AC 32 ms
53,460 KB
testcase_18 AC 36 ms
59,736 KB
testcase_19 AC 933 ms
361,964 KB
testcase_20 AC 38 ms
59,868 KB
testcase_21 AC 32 ms
53,460 KB
testcase_22 AC 36 ms
53,460 KB
testcase_23 AC 38 ms
59,768 KB
testcase_24 AC 32 ms
53,460 KB
testcase_25 AC 33 ms
53,460 KB
testcase_26 AC 235 ms
153,792 KB
testcase_27 AC 1,560 ms
486,016 KB
testcase_28 AC 328 ms
179,948 KB
testcase_29 AC 113 ms
103,020 KB
testcase_30 AC 310 ms
163,136 KB
testcase_31 AC 772 ms
288,516 KB
testcase_32 AC 148 ms
123,280 KB
testcase_33 AC 106 ms
103,020 KB
testcase_34 AC 1,576 ms
486,012 KB
testcase_35 AC 104 ms
104,824 KB
testcase_36 AC 100 ms
104,824 KB
testcase_37 AC 56 ms
78,376 KB
testcase_38 AC 181 ms
137,012 KB
testcase_39 AC 338 ms
163,132 KB
testcase_40 AC 313 ms
163,132 KB
testcase_41 AC 186 ms
137,016 KB
testcase_42 AC 311 ms
179,944 KB
testcase_43 AC 60 ms
78,376 KB
testcase_44 AC 162 ms
121,748 KB
testcase_45 AC 996 ms
361,832 KB
testcase_46 AC 118 ms
104,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

N, K = map(int, input().split())
A = list(map(int, input().split()))
C = list(combinations(range(N), K))
MOD1 = 998
MOD2 = 998244353
ans = 0
for cmb in C:
    S_998 = 0
    S_998244353 = 0
    for i in cmb:
        S_998 += A[i]
        S_998244353 += A[i]
        S_998 %= MOD1
        S_998244353 %= MOD2
    ans += S_998244353 <= S_998
    ans %= MOD1

print(ans)
0