結果

問題 No.126 2基のエレベータ
ユーザー JunOnuma
提出日時 2017-06-19 11:11:16
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 6,948 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-02 07:37:22
合計ジャッジ時間 1,328 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,s = map(int, raw_input().split())
if s == 1:
    d = a
elif abs(b-s) < abs(a-s):
    d = abs(b-s)
    if a == 0:
        d += s-1
        d += 2
    else:
        d += min(s-1, abs(a-s))
        d += a
else:
    d = abs(a-s)
    d += s
print d
0