結果
| 問題 | No.2561 みんな大好きmod 998 |
| コンテスト | |
| ユーザー |
けんぴん
|
| 提出日時 | 2023-11-06 00:36:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 390 ms / 4,000 ms |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 82,276 KB |
| 実行使用メモリ | 75,648 KB |
| 最終ジャッジ日時 | 2024-09-25 22:54:42 |
| 合計ジャッジ時間 | 7,282 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
# combinationsで組み合わせを列挙
from itertools import combinations
def main():
N,K = map(int,input().split())
assert 1 <= N <= 28
assert 1 <= K <= min(8,N)
A = list(map(int,input().split()))
for a in A:
assert 0 <= a <= 998244352
ans = 0
for comb in combinations(A,K):
sum_comb = sum(comb)
if sum_comb % 998244353 <= sum_comb % 998:
ans += 1
print(ans % 998)
if __name__ == "__main__":
main()
けんぴん