結果

問題 No.2561 みんな大好きmod 998
ユーザー Basin-BugBasin-Bug
提出日時 2023-12-02 14:49:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 545 ms / 4,000 ms
コード長 323 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 75,052 KB
最終ジャッジ日時 2023-12-02 14:50:07
合計ジャッジ時間 8,543 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 72 ms
75,052 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 524 ms
75,052 KB
testcase_04 AC 545 ms
75,048 KB
testcase_05 AC 517 ms
75,048 KB
testcase_06 AC 521 ms
75,048 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 36 ms
53,460 KB
testcase_09 AC 42 ms
59,768 KB
testcase_10 AC 36 ms
53,460 KB
testcase_11 AC 94 ms
75,024 KB
testcase_12 AC 36 ms
53,460 KB
testcase_13 AC 36 ms
53,460 KB
testcase_14 AC 40 ms
53,456 KB
testcase_15 AC 390 ms
75,048 KB
testcase_16 AC 37 ms
53,460 KB
testcase_17 AC 36 ms
53,460 KB
testcase_18 AC 41 ms
59,772 KB
testcase_19 AC 333 ms
75,048 KB
testcase_20 AC 41 ms
59,772 KB
testcase_21 AC 35 ms
53,460 KB
testcase_22 AC 35 ms
53,460 KB
testcase_23 AC 41 ms
59,772 KB
testcase_24 AC 36 ms
53,460 KB
testcase_25 AC 36 ms
53,460 KB
testcase_26 AC 112 ms
75,024 KB
testcase_27 AC 520 ms
75,048 KB
testcase_28 AC 146 ms
75,024 KB
testcase_29 AC 71 ms
75,024 KB
testcase_30 AC 163 ms
75,048 KB
testcase_31 AC 290 ms
75,048 KB
testcase_32 AC 84 ms
75,024 KB
testcase_33 AC 73 ms
75,024 KB
testcase_34 AC 519 ms
75,048 KB
testcase_35 AC 68 ms
75,024 KB
testcase_36 AC 67 ms
75,024 KB
testcase_37 AC 53 ms
70,032 KB
testcase_38 AC 95 ms
75,024 KB
testcase_39 AC 169 ms
75,048 KB
testcase_40 AC 160 ms
75,048 KB
testcase_41 AC 94 ms
75,024 KB
testcase_42 AC 135 ms
75,024 KB
testcase_43 AC 53 ms
70,032 KB
testcase_44 AC 83 ms
75,024 KB
testcase_45 AC 384 ms
75,048 KB
testcase_46 AC 73 ms
75,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
MOD1 = 998
MOD2 = 998244353

for i in itertools.combinations(A, K):
  cnt1 = 0
  cnt2 = 0
  for j in i:
    cnt1 += j
    cnt2 += j
    cnt1 %= MOD1
    cnt2 %= MOD2
  
  if cnt1 >= cnt2:
    ans += 1
    ans %= MOD1

print(ans)
0