結果
問題 | No.2561 みんな大好きmod 998 |
ユーザー | timi |
提出日時 | 2023-12-02 14:48:20 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 509 ms / 4,000 ms |
コード長 | 261 bytes |
コンパイル時間 | 1,172 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 76,288 KB |
最終ジャッジ日時 | 2024-09-26 17:26:51 |
合計ジャッジ時間 | 8,651 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
N,K=map(int, input().split()) A=list(map(int, input().split())) import itertools B=itertools.combinations([i for i in range(N)],K) ans=0 x,y=998244353,998 for b in B: c=0 for i in range(K): c+=A[b[i]] if c%x<=c%y: ans+=1 ans%=y print(ans)