結果

問題 No.126 2基のエレベータ
ユーザー 小指が強い人小指が強い人
提出日時 2015-12-05 02:02:47
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 134 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,368 KB
最終ジャッジ日時 2023-10-12 15:28:30
合計ジャッジ時間 4,014 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,228 KB
testcase_01 WA -
testcase_02 AC 77 ms
15,132 KB
testcase_03 AC 78 ms
15,188 KB
testcase_04 AC 78 ms
15,160 KB
testcase_05 AC 79 ms
15,160 KB
testcase_06 AC 78 ms
15,148 KB
testcase_07 WA -
testcase_08 AC 80 ms
15,176 KB
testcase_09 AC 79 ms
15,196 KB
testcase_10 AC 79 ms
15,184 KB
testcase_11 AC 77 ms
15,092 KB
testcase_12 AC 78 ms
15,048 KB
testcase_13 AC 78 ms
15,152 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 79 ms
15,152 KB
testcase_17 WA -
testcase_18 AC 78 ms
15,180 KB
testcase_19 AC 78 ms
15,292 KB
testcase_20 WA -
testcase_21 AC 79 ms
15,136 KB
testcase_22 AC 77 ms
15,088 KB
testcase_23 AC 78 ms
15,128 KB
testcase_24 AC 79 ms
15,060 KB
testcase_25 AC 79 ms
15,300 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 79 ms
15,124 KB
testcase_29 AC 78 ms
15,180 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a, b, s = gets.split.map(&:to_i)
da = (a - s).abs
db = (b - s).abs
if da <= db || s == 1
    puts da + s
else
    puts db + da + a
end
0