結果
| 問題 | No.2561 みんな大好きmod 998 |
| コンテスト | |
| ユーザー |
toshiconner
|
| 提出日時 | 2023-12-02 15:06:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 495 ms / 4,000 ms |
| コード長 | 393 bytes |
| 記録 | |
| コンパイル時間 | 124 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 81,024 KB |
| 最終ジャッジ日時 | 2026-04-13 19:18:28 |
| 合計ジャッジ時間 | 7,877 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
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)
toshiconner