結果

問題 No.126 2基のエレベータ
ユーザー Konton7Konton7
提出日時 2019-05-22 01:23:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 280 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 11,824 KB
実行使用メモリ 10,148 KB
最終ジャッジ日時 2023-10-17 10:50:44
合計ジャッジ時間 2,208 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,064 KB
testcase_01 RE -
testcase_02 AC 26 ms
10,064 KB
testcase_03 AC 27 ms
10,064 KB
testcase_04 AC 27 ms
10,064 KB
testcase_05 AC 27 ms
10,064 KB
testcase_06 AC 27 ms
10,064 KB
testcase_07 RE -
testcase_08 AC 27 ms
10,064 KB
testcase_09 AC 26 ms
10,064 KB
testcase_10 AC 27 ms
10,064 KB
testcase_11 AC 26 ms
10,064 KB
testcase_12 AC 27 ms
10,064 KB
testcase_13 AC 27 ms
10,064 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 26 ms
10,064 KB
testcase_17 WA -
testcase_18 AC 26 ms
10,064 KB
testcase_19 AC 27 ms
10,064 KB
testcase_20 WA -
testcase_21 AC 27 ms
10,064 KB
testcase_22 AC 27 ms
10,064 KB
testcase_23 AC 27 ms
10,064 KB
testcase_24 AC 27 ms
10,064 KB
testcase_25 AC 27 ms
10,064 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 27 ms
10,064 KB
testcase_29 AC 27 ms
10,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, s =  [ int(v) for v in input().split() ]

if s == 1:
    ans = abs(s-a)+1
else:
    dsa = abs(s-a)
    dsb = abs(s-b)
    if dsa <= dsb:
        ans = dsa + s
    else:
        if a == 0:
            dsb + s + 1
        else:
            ans = dsa + dsb + a



print(ans)

0