結果
| 問題 |
No.46 はじめのn歩
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-02 18:24:34 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 5,000 ms |
| コード長 | 479 bytes |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-11-06 18:36:16 |
| 合計ジャッジ時間 | 1,591 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
Syntax OK
ソースコード
class Firststep
attr_reader :a, :b
def initialize(a: 0, b: 0)
@a, @b = a, b
end
def datainput
begin
@a, @b = gets.chomp.split.map { |v| Integer(v) }
rescue
end
end
def how_many_steps?(a, b)
(b / a.to_f).ceil
end
def dataoutput
puts how_many_steps?(@a, @b)
end
def run
datainput
dataoutput
end
end
if $0 == __FILE__
Firststep.new.run
end