結果

問題 No.126 2基のエレベータ
ユーザー gigurururugigurururu
提出日時 2015-01-14 18:51:48
言語 Ruby
(3.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 132 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 11,212 KB
実行使用メモリ 15,308 KB
最終ジャッジ日時 2023-08-14 01:19:58
合計ジャッジ時間 3,642 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,072 KB
testcase_01 AC 77 ms
15,152 KB
testcase_02 WA -
testcase_03 AC 77 ms
15,148 KB
testcase_04 AC 76 ms
15,064 KB
testcase_05 AC 76 ms
15,224 KB
testcase_06 AC 81 ms
15,056 KB
testcase_07 AC 78 ms
15,104 KB
testcase_08 AC 78 ms
15,272 KB
testcase_09 AC 77 ms
15,152 KB
testcase_10 AC 76 ms
15,280 KB
testcase_11 AC 76 ms
15,236 KB
testcase_12 AC 78 ms
15,272 KB
testcase_13 AC 77 ms
15,304 KB
testcase_14 AC 76 ms
15,132 KB
testcase_15 AC 76 ms
15,268 KB
testcase_16 AC 77 ms
15,280 KB
testcase_17 AC 76 ms
15,028 KB
testcase_18 AC 76 ms
15,260 KB
testcase_19 AC 77 ms
15,004 KB
testcase_20 AC 76 ms
15,064 KB
testcase_21 AC 77 ms
15,220 KB
testcase_22 AC 77 ms
15,232 KB
testcase_23 AC 77 ms
15,236 KB
testcase_24 AC 78 ms
15,112 KB
testcase_25 AC 76 ms
15,308 KB
testcase_26 AC 76 ms
15,096 KB
testcase_27 AC 76 ms
15,036 KB
testcase_28 AC 76 ms
15,220 KB
testcase_29 AC 76 ms
15,220 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a,b,s=gets.split.map(&:to_i)
c,d=(a-s).abs,(b-s).abs
p (if c>d
  if a<1
    d+s-1+2
  else
    d+[c,s-1].min+a
  end
else
  c+s
end)
0