結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 79 ms
71,464 KB
testcase_02 WA -
testcase_03 AC 78 ms
71,416 KB
testcase_04 AC 76 ms
71,476 KB
testcase_05 AC 74 ms
71,452 KB
testcase_06 AC 74 ms
71,416 KB
testcase_07 AC 74 ms
71,212 KB
testcase_08 AC 74 ms
71,160 KB
testcase_09 AC 74 ms
71,368 KB
testcase_10 AC 77 ms
71,380 KB
testcase_11 AC 77 ms
71,324 KB
testcase_12 AC 75 ms
71,400 KB
testcase_13 AC 75 ms
71,320 KB
testcase_14 AC 76 ms
71,396 KB
testcase_15 AC 74 ms
71,108 KB
testcase_16 WA -
testcase_17 AC 73 ms
71,276 KB
testcase_18 AC 74 ms
71,532 KB
testcase_19 AC 73 ms
71,412 KB
testcase_20 AC 75 ms
71,104 KB
testcase_21 AC 76 ms
71,256 KB
testcase_22 AC 77 ms
71,296 KB
testcase_23 AC 75 ms
71,452 KB
testcase_24 AC 75 ms
71,328 KB
testcase_25 AC 74 ms
71,256 KB
testcase_26 AC 74 ms
71,480 KB
testcase_27 AC 73 ms
71,336 KB
testcase_28 AC 73 ms
71,276 KB
testcase_29 AC 73 ms
71,264 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 - 1)
0