結果

問題 No.46 はじめのn歩
ユーザー tshigtshig
提出日時 2016-08-02 17:42:45
言語 Ruby
(3.3.0)
結果
AC  
実行時間 85 ms / 5,000 ms
コード長 277 bytes
コンパイル時間 34 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-24 15:08:19
合計ジャッジ時間 1,404 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
12,288 KB
testcase_01 AC 84 ms
12,032 KB
testcase_02 AC 81 ms
12,160 KB
testcase_03 AC 77 ms
12,032 KB
testcase_04 AC 85 ms
12,288 KB
testcase_05 AC 84 ms
12,160 KB
testcase_06 AC 80 ms
12,288 KB
testcase_07 AC 78 ms
12,160 KB
testcase_08 AC 74 ms
12,160 KB
testcase_09 AC 81 ms
12,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Calc0046
  def initialize(args)
    args = args.map { |l| l.chomp.split(/\s+/) }
    @a, @b = args.shift.map(&:to_i)
  end

  def run
    if @b % @a == 0
      @b / @a
    else
      @b / @a + 1
    end
  end
end

puts Calc0046.new(STDIN.readlines).run if __FILE__ == $0
0