結果

問題 No.126 2基のエレベータ
ユーザー 👑 colognecologne
提出日時 2022-03-02 15:03:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 867 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 71,408 KB
最終ジャッジ日時 2023-09-23 08:16:19
合計ジャッジ時間 3,891 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 75 ms
71,228 KB
testcase_04 AC 74 ms
71,124 KB
testcase_05 AC 75 ms
70,904 KB
testcase_06 AC 75 ms
71,128 KB
testcase_07 WA -
testcase_08 AC 77 ms
70,816 KB
testcase_09 AC 75 ms
71,316 KB
testcase_10 AC 76 ms
71,136 KB
testcase_11 AC 76 ms
70,888 KB
testcase_12 WA -
testcase_13 AC 74 ms
71,036 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 75 ms
71,180 KB
testcase_18 AC 77 ms
70,884 KB
testcase_19 AC 76 ms
71,072 KB
testcase_20 WA -
testcase_21 AC 78 ms
71,252 KB
testcase_22 AC 76 ms
71,124 KB
testcase_23 AC 76 ms
70,896 KB
testcase_24 AC 75 ms
71,092 KB
testcase_25 AC 76 ms
71,096 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)
    elif A == 0:
        print(abs(S-B) + (B-1) + 2)
    else:
        print(abs(S-B) + min(abs(B-A), abs(B-1)) + A)


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