結果

問題 No.965 門松列が嫌い
ユーザー tachyon777tachyon777
提出日時 2020-01-17 20:25:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 1,000 ms
コード長 226 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 71,332 KB
最終ジャッジ日時 2023-09-07 22:24:29
合計ジャッジ時間 2,108 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,188 KB
testcase_01 AC 86 ms
70,932 KB
testcase_02 AC 82 ms
71,164 KB
testcase_03 AC 81 ms
71,276 KB
testcase_04 AC 80 ms
71,332 KB
testcase_05 AC 78 ms
71,104 KB
testcase_06 AC 76 ms
71,136 KB
testcase_07 AC 79 ms
71,280 KB
testcase_08 AC 78 ms
71,096 KB
testcase_09 AC 81 ms
71,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if b < a:
    ans = a-b

else:
    ans = b-c


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