結果

問題 No.126 2基のエレベータ
ユーザー simansiman
提出日時 2015-03-31 00:18:09
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 15,432 KB
最終ジャッジ日時 2023-09-17 00:33:18
合計ジャッジ時間 3,956 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 75 ms
15,040 KB
testcase_04 AC 76 ms
15,160 KB
testcase_05 AC 77 ms
15,332 KB
testcase_06 AC 78 ms
15,156 KB
testcase_07 WA -
testcase_08 AC 74 ms
15,116 KB
testcase_09 AC 75 ms
15,076 KB
testcase_10 AC 77 ms
15,028 KB
testcase_11 AC 77 ms
15,284 KB
testcase_12 AC 77 ms
15,164 KB
testcase_13 AC 75 ms
15,292 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 75 ms
15,144 KB
testcase_19 AC 74 ms
15,140 KB
testcase_20 WA -
testcase_21 AC 76 ms
15,240 KB
testcase_22 AC 75 ms
15,272 KB
testcase_23 AC 73 ms
15,252 KB
testcase_24 AC 75 ms
15,036 KB
testcase_25 AC 77 ms
15,240 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 75 ms
15,112 KB
testcase_29 AC 75 ms
15,156 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Yukicoder
  def initialize
    a, b, s = gets.chomp.split(' ').map(&:to_i)

    route1 = (s - a).abs + s
    route2 = (s - b).abs + (s - a) + a + ((a.zero?) ? 2 : 0)

    puts [route1, route2].min
  end
end

Yukicoder.new
0