結果

問題 No.126 2基のエレベータ
ユーザー rlangevinrlangevin
提出日時 2023-01-27 12:31:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 191 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 71,568 KB
最終ジャッジ日時 2023-09-10 08:19:47
合計ジャッジ時間 3,989 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
70,972 KB
testcase_01 AC 70 ms
71,204 KB
testcase_02 AC 70 ms
70,804 KB
testcase_03 AC 70 ms
70,952 KB
testcase_04 AC 71 ms
71,152 KB
testcase_05 AC 69 ms
70,968 KB
testcase_06 AC 70 ms
71,056 KB
testcase_07 AC 68 ms
71,060 KB
testcase_08 AC 67 ms
70,832 KB
testcase_09 AC 69 ms
71,060 KB
testcase_10 AC 70 ms
71,208 KB
testcase_11 AC 68 ms
71,272 KB
testcase_12 AC 70 ms
71,032 KB
testcase_13 AC 70 ms
71,060 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 68 ms
71,332 KB
testcase_17 WA -
testcase_18 AC 69 ms
71,112 KB
testcase_19 AC 69 ms
71,068 KB
testcase_20 WA -
testcase_21 AC 70 ms
71,024 KB
testcase_22 AC 69 ms
71,032 KB
testcase_23 AC 71 ms
71,112 KB
testcase_24 AC 68 ms
71,324 KB
testcase_25 AC 71 ms
71,028 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 68 ms
71,064 KB
testcase_29 AC 69 ms
71,064 KB
権限があれば一括ダウンロードができます

ソースコード

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(S - A) + A)
0