結果

問題 No.126 2基のエレベータ
ユーザー kohei2019kohei2019
提出日時 2021-06-18 02:01:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 223 bytes
コンパイル時間 890 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 71,584 KB
最終ジャッジ日時 2023-09-02 13:31:59
合計ジャッジ時間 4,741 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 73 ms
70,908 KB
testcase_02 WA -
testcase_03 AC 72 ms
71,076 KB
testcase_04 AC 72 ms
70,872 KB
testcase_05 AC 74 ms
70,996 KB
testcase_06 AC 71 ms
70,936 KB
testcase_07 AC 72 ms
71,160 KB
testcase_08 AC 72 ms
71,192 KB
testcase_09 AC 73 ms
70,688 KB
testcase_10 AC 72 ms
70,640 KB
testcase_11 AC 71 ms
70,896 KB
testcase_12 AC 73 ms
70,908 KB
testcase_13 AC 75 ms
70,984 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 73 ms
71,188 KB
testcase_19 AC 72 ms
70,996 KB
testcase_20 WA -
testcase_21 AC 73 ms
71,004 KB
testcase_22 AC 72 ms
71,000 KB
testcase_23 AC 73 ms
71,048 KB
testcase_24 AC 74 ms
71,048 KB
testcase_25 AC 75 ms
71,024 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 72 ms
71,024 KB
testcase_29 AC 74 ms
70,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,S = map(int,input().split())

if abs(S-A) <= abs(S-B):
    print(abs(S-A)+S)
else:
    ans = abs(S-B)
    if A == 0:
        print(ans + S + 1)
    elif A < S:
        print(ans + S)
    else:
        print(ans + S + A)
0