結果
| 問題 | No.63 ポッキーゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-07 02:18:05 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 5,000 ms |
| コード長 | 593 bytes |
| 記録 | |
| コンパイル時間 | 84 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 14,848 KB |
| 最終ジャッジ日時 | 2026-05-30 02:20:28 |
| 合計ジャッジ時間 | 2,390 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
Syntax OK
ソースコード
class PockyGame
attr_reader :l, :k
def initialize(l: 0, k: 0)
@l, @k = l, k
end
def datainput
begin
@l, @k = gets.chomp.split.map { |v| Integer(v) }
rescue
end
end
def pockygame(pocky_length, once_length)
cnt = pocky_length / (once_length * 2)
cnt -= 1 if pocky_length % (once_length * 2) == 0
once_length * cnt
end
def dataoutput
puts pockygame(@l, @k)
end
def run
datainput
dataoutput
end
end
if $0 == __FILE__
PockyGame.new.run
end