結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー rkyrky
提出日時 2017-11-14 21:35:37
言語 Ruby
(3.4.1)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 171 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-25 02:15:22
合計ジャッジ時間 3,376 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

box, th = gets.chomp.split(' ').map(&:to_i)
if th == 0 || th > box
	puts 0
else
	if box % 2 == 1 && th == (box.to_f / 2).round
		puts box - 1
	else
		puts box - 2
	end
end
0