結果
| 問題 | No.2561 みんな大好きmod 998 |
| コンテスト | |
| ユーザー |
けんぴん
|
| 提出日時 | 2023-10-29 18:52:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 469 ms / 4,000 ms |
| コード長 | 438 bytes |
| 記録 | |
| コンパイル時間 | 243 ms |
| コンパイル使用メモリ | 82,208 KB |
| 実行使用メモリ | 75,904 KB |
| 最終ジャッジ日時 | 2024-09-25 22:28:39 |
| 合計ジャッジ時間 | 8,793 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
from itertools import combinations
def main():
N,K = map(int,input().split())
assert 1 <= N <= 35
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()
けんぴん