結果

問題 No.126 2基のエレベータ
ユーザー rlangevinrlangevin
提出日時 2023-01-27 08:58:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 191 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 71,656 KB
最終ジャッジ日時 2023-09-10 05:34:20
合計ジャッジ時間 4,630 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 74 ms
71,404 KB
testcase_02 AC 73 ms
71,252 KB
testcase_03 AC 76 ms
71,248 KB
testcase_04 AC 73 ms
71,220 KB
testcase_05 AC 73 ms
71,328 KB
testcase_06 AC 72 ms
71,320 KB
testcase_07 AC 73 ms
71,400 KB
testcase_08 AC 72 ms
71,328 KB
testcase_09 AC 73 ms
71,100 KB
testcase_10 AC 74 ms
71,340 KB
testcase_11 AC 72 ms
71,476 KB
testcase_12 WA -
testcase_13 AC 76 ms
71,108 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 74 ms
71,192 KB
testcase_18 AC 75 ms
71,216 KB
testcase_19 AC 75 ms
71,328 KB
testcase_20 WA -
testcase_21 AC 74 ms
71,252 KB
testcase_22 AC 74 ms
71,540 KB
testcase_23 AC 75 ms
71,348 KB
testcase_24 AC 74 ms
71,324 KB
testcase_25 AC 75 ms
71,200 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, S = map(int, input().split())
dA, dB = abs(S - A), abs(S - B)

if S == 1 or dA <= dB:
    print(dA + S)
    exit()

if A == 0:
    print(dB + S + 1)
else:
    print(dB + abs(B - A) + A)
0