結果
| 問題 |
No.2561 みんな大好きmod 998
|
| コンテスト | |
| ユーザー |
かもめのうで
|
| 提出日時 | 2023-12-02 15:31:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 453 ms / 4,000 ms |
| コード長 | 312 bytes |
| コンパイル時間 | 439 ms |
| コンパイル使用メモリ | 82,644 KB |
| 実行使用メモリ | 75,676 KB |
| 最終ジャッジ日時 | 2024-09-26 18:50:59 |
| 合計ジャッジ時間 | 7,898 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
mod1 = 998
mod2 = 998244353
from itertools import combinations
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for c in combinations([i for i in range(n)], k):
s = 0
for i in c:
s += a[i]
if s%mod2 <= s%mod1:
ans += 1
ans %= mod1
print(ans%mod1)
かもめのうで