結果
| 問題 |
No.2561 みんな大好きmod 998
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-02 15:35:56 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 252 bytes |
| コンパイル時間 | 415 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 18,688 KB |
| 最終ジャッジ日時 | 2024-09-26 18:58:54 |
| 合計ジャッジ時間 | 9,984 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 43 |
コンパイルメッセージ
Syntax OK
ソースコード
n,k=gets.split.map &:to_i
a=gets.split.map &:to_i
ans=0
(1<<n).times{|i|
c=0
x=[]
n.times{|j|
if i>>j&1==1 then
x.append(a[j])
c+=1
end
}
if c==k then
y=x.sum
if y%998>=y%998244353 then ans+=1 end
end
}
p ans%998