結果

問題 No.333 門松列を数え上げ
ユーザー lam6er
提出日時 2025-03-20 21:21:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,136 KB
実行使用メモリ 53,320 KB
最終ジャッジ日時 2025-03-20 21:22:23
合計ジャッジ時間 1,089 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())

case1 = 0
if B > A:
    case1 = A - 1
else:
    case1 = (2 * 10**9) - A

diff = abs(A - B)
case2 = diff - 1 if diff > 1 else 0

print(case1 + case2)
0