結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
コンテスト
ユーザー rky
提出日時 2017-11-14 21:26:28
言語 Ruby
(4.0.2)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
MLE  
実行時間 -
コード長 181 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 110 ms
コンパイル使用メモリ 9,216 KB
実行使用メモリ 533,760 KB
最終ジャッジ日時 2026-05-19 09:27:40
合計ジャッジ時間 4,462 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 MLE * 1 -- * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #
raw source code

box, th = gets.chomp.split(' ').map(&:to_i)
list = Array.new
box.times{ list << 1 }
list[th - 1], list[-th] = 0, 0
list[0..list.length] = 0 if th == 0 || th > box
puts list.count(1)
0