結果

問題 No.63 ポッキーゲーム
ユーザー korogykorogy
提出日時 2017-09-07 02:09:08
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 612 bytes
コンパイル時間 32 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 17,536 KB
最終ジャッジ日時 2024-04-24 15:26:06
合計ジャッジ時間 8,018 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
12,288 KB
testcase_01 AC 88 ms
12,160 KB
testcase_02 AC 87 ms
12,288 KB
testcase_03 AC 85 ms
12,160 KB
testcase_04 AC 82 ms
12,032 KB
testcase_05 AC 81 ms
12,288 KB
testcase_06 AC 82 ms
12,288 KB
testcase_07 AC 87 ms
12,288 KB
testcase_08 AC 85 ms
12,160 KB
testcase_09 AC 116 ms
12,160 KB
testcase_10 AC 411 ms
12,160 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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
0