結果

問題 No.126 2基のエレベータ
ユーザー 👑 colognecologne
提出日時 2022-03-02 15:01:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 224 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 71,484 KB
最終ジャッジ日時 2023-09-23 08:15:13
合計ジャッジ時間 4,135 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 76 ms
71,060 KB
testcase_04 AC 75 ms
70,884 KB
testcase_05 AC 75 ms
71,076 KB
testcase_06 AC 75 ms
71,100 KB
testcase_07 WA -
testcase_08 AC 75 ms
71,112 KB
testcase_09 AC 75 ms
71,316 KB
testcase_10 AC 73 ms
70,768 KB
testcase_11 AC 74 ms
71,064 KB
testcase_12 WA -
testcase_13 AC 74 ms
71,044 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 73 ms
71,060 KB
testcase_18 AC 74 ms
71,044 KB
testcase_19 AC 74 ms
71,304 KB
testcase_20 WA -
testcase_21 AC 73 ms
71,016 KB
testcase_22 AC 75 ms
70,764 KB
testcase_23 AC 74 ms
70,792 KB
testcase_24 AC 74 ms
71,000 KB
testcase_25 AC 74 ms
70,900 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    A, B, S = map(int, input().split())
    if abs(S-A) <= abs(S-B):
        print(abs(S-A) + S)
    else:
        print(abs(S-B) + min(abs(B-A), abs(B-1)) + abs(A-1) + 1)


if __name__ == '__main__':
    main()
0