結果

問題 No.965 門松列が嫌い
ユーザー tachyon777tachyon777
提出日時 2020-01-17 20:21:13
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 229 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 79,816 KB
最終ジャッジ日時 2023-09-07 22:20:31
合計ジャッジ時間 3,088 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,460 KB
testcase_01 AC 76 ms
71,412 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c = map(int,input().split())
ans = 0
if a ==c:
    print(abs(a-b)+1)
    exit()
if a > c:
    a,c = c,a
while a >= b or b >= c:
    if a > b:
        b+= 1
    else:
        b -= 1
    ans += 1

ans = min(ans,c-a)
print(ans)
0