結果

問題 No.63 ポッキーゲーム
ユーザー sjgq5302
提出日時 2017-07-22 08:47:45
言語 Ruby
(3.4.1)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 301 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-12-24 05:36:40
合計ジャッジ時間 2,613 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: `elsif' at the end of line without an expression
Syntax OK

ソースコード

diff #

input = gets.split(" ").map(&:to_i)
length = input[0] #ポッキーの長さ
bite = input[1] #1回にかじる長さ

bite_times = length / (bite * 2) #かじる回数

if (length % (bite * 2)) == 0
    bite_by_yu = (bite_times - 1) * bite
elsif
    bite_by_yu = bite_times * bite
end

puts bite_by_yu
0