結果

問題 No.965 門松列が嫌い
ユーザー tachyon777
提出日時 2020-01-17 20:24:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-06-25 15:59:26
合計ジャッジ時間 1,312 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 2
権限があれば一括ダウンロードができます

ソースコード

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+1

else:
    ans = b-c+1


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