結果
| 問題 | No.63 ポッキーゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-07 02:09:08 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 612 bytes |
| 記録 | |
| コンパイル時間 | 191 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 24,448 KB |
| 最終ジャッジ日時 | 2024-11-06 23:58:41 |
| 合計ジャッジ時間 | 8,335 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 TLE * 1 -- * 10 |
コンパイルメッセージ
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 = 0
loop do
break if pocky_length <= (once_length*2*cnt)
cnt += 1
end
once_length*(cnt-1)
end
def dataoutput
puts pockygame(@l, @k)
end
def run
datainput
dataoutput
end
end
if $0 == __FILE__
PockyGame.new.run
end