結果

問題 No.1860 Magnets
ユーザー Hentci
提出日時 2022-03-08 15:00:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-23 14:44:06
合計ジャッジ時間 1,943 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

x, y = map(int, input().split())

mn = min(x, y)
mx = max(x, y)

if x == y:
    print(x * 2)
elif x == 0 and y == 0:
    print(0)
elif x == 0 or y == 0:
    print(mx * 2 - 1)
else:
    print((mx - mn) * 2 + mn * 2 - 1) 
0