結果

問題 No.299 蟻本が読めない
ユーザー korogykorogy
提出日時 2017-09-12 17:33:01
言語 Ruby
(3.3.0)
結果
AC  
実行時間 99 ms / 1,000 ms
コード長 430 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-25 07:07:18
合計ジャッジ時間 922 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
12,160 KB
testcase_01 AC 93 ms
12,160 KB
testcase_02 AC 87 ms
12,416 KB
testcase_03 AC 88 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class AntBooks
    attr_reader :n

    def initialize(n: 0)
        @n = n
    end

    def cause
        begin
            @n = Integer(gets.chomp)
        rescue
            
        end
    end

    def arithmetic_sequence(n)        
        316 + (52 * (n-1))
    end

    def result
        puts arithmetic_sequence(@n)
    end

    def run
        cause
        result
    end
end

if $0 == __FILE__
    AntBooks.new.run
end
0