結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 71 ms
15,116 KB
testcase_02 WA -
testcase_03 AC 70 ms
15,028 KB
testcase_04 AC 68 ms
15,272 KB
testcase_05 AC 67 ms
15,140 KB
testcase_06 AC 69 ms
15,220 KB
testcase_07 AC 71 ms
15,172 KB
testcase_08 AC 66 ms
15,036 KB
testcase_09 AC 70 ms
15,188 KB
testcase_10 AC 67 ms
15,116 KB
testcase_11 AC 70 ms
15,116 KB
testcase_12 AC 67 ms
15,272 KB
testcase_13 AC 71 ms
15,228 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 67 ms
15,088 KB
testcase_19 AC 67 ms
15,224 KB
testcase_20 WA -
testcase_21 AC 66 ms
15,028 KB
testcase_22 AC 67 ms
15,160 KB
testcase_23 AC 66 ms
15,136 KB
testcase_24 AC 65 ms
15,220 KB
testcase_25 AC 67 ms
15,084 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 67 ms
15,196 KB
testcase_29 AC 66 ms
15,188 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?) ? 1 : 0)

    puts [route1, route2].min
  end
end

Yukicoder.new
0