結果

問題 No.126 2基のエレベータ
ユーザー tnoda_tnoda_
提出日時 2015-08-12 00:26:01
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 210 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 77,596 KB
実行使用メモリ 76,596 KB
最終ジャッジ日時 2023-09-25 08:15:04
合計ジャッジ時間 3,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,384 KB
testcase_01 AC 75 ms
76,496 KB
testcase_02 WA -
testcase_03 AC 76 ms
76,368 KB
testcase_04 AC 76 ms
76,252 KB
testcase_05 AC 78 ms
76,592 KB
testcase_06 AC 76 ms
76,300 KB
testcase_07 AC 75 ms
76,400 KB
testcase_08 AC 74 ms
76,116 KB
testcase_09 AC 75 ms
76,576 KB
testcase_10 AC 76 ms
76,388 KB
testcase_11 AC 76 ms
76,596 KB
testcase_12 AC 75 ms
76,148 KB
testcase_13 AC 74 ms
76,580 KB
testcase_14 AC 74 ms
76,568 KB
testcase_15 AC 76 ms
76,392 KB
testcase_16 AC 74 ms
76,360 KB
testcase_17 AC 75 ms
76,480 KB
testcase_18 AC 75 ms
76,376 KB
testcase_19 AC 76 ms
76,276 KB
testcase_20 AC 75 ms
76,120 KB
testcase_21 AC 76 ms
76,384 KB
testcase_22 AC 76 ms
76,112 KB
testcase_23 AC 75 ms
76,152 KB
testcase_24 AC 76 ms
76,400 KB
testcase_25 AC 75 ms
76,400 KB
testcase_26 AC 78 ms
76,160 KB
testcase_27 AC 77 ms
76,352 KB
testcase_28 AC 78 ms
76,276 KB
testcase_29 AC 76 ms
76,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, S = map(int, raw_input().strip().split())
ans = 0
if A == 0:
    ans = A = 1
if abs(S - A) <= abs(S - B):
    ans += abs(S - A) + S
else:
    ans += abs(S - B) + min(S - 1 + A, abs(S - A) + A)
print(ans)
0