結果
| 問題 | No.2561 みんな大好きmod 998 |
| コンテスト | |
| ユーザー |
あ
|
| 提出日時 | 2023-12-13 23:16:14 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 432 ms / 4,000 ms |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 80,512 KB |
| 最終ジャッジ日時 | 2026-04-14 01:19:21 |
| 合計ジャッジ時間 | 6,429 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
from itertools import combinations
mod1 = 998
mod2 = 998244353
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for v in combinations(range(n), k):
s1 = 0
s2 = 0
for i in v:
s1 += a[i]
s1 %= mod1
s2 += a[i]
s2 %= mod2
if s2 <= s1:
ans += 1
ans %= mod1
print(ans)
あ