結果

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

ソースコード

diff #

a,b,s = map(int, raw_input().split())
if 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