結果
| 問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2017-06-24 04:28:31 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 2,000 ms |
| コード長 | 167 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-10-04 01:13:12 |
| 合計ジャッジ時間 | 3,503 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
コンパイルメッセージ
Syntax OK
ソースコード
n,k=gets.chomp.split.map{|e| e.to_i}
if k==0||n<k then
puts 0
else
if n%2==1 then
if k==n/2+n%2 then
puts n-1
else
puts n-2
end
else
puts n-2
end
end
horiesiniti