結果

問題 No.1860 Magnets
ユーザー 👑 tamatotamato
提出日時 2022-03-04 21:23:41
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 464 ms
コンパイル使用メモリ 87,408 KB
実行使用メモリ 71,792 KB
最終ジャッジ日時 2023-09-25 23:29:51
合計ジャッジ時間 3,889 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,408 KB
testcase_01 AC 71 ms
71,784 KB
testcase_02 AC 71 ms
71,548 KB
testcase_03 AC 73 ms
71,684 KB
testcase_04 AC 75 ms
71,612 KB
testcase_05 AC 73 ms
71,764 KB
testcase_06 AC 72 ms
71,596 KB
testcase_07 AC 73 ms
71,508 KB
testcase_08 AC 71 ms
71,604 KB
testcase_09 AC 73 ms
71,692 KB
testcase_10 AC 71 ms
71,720 KB
testcase_11 AC 72 ms
71,776 KB
testcase_12 AC 74 ms
71,792 KB
testcase_13 AC 71 ms
71,676 KB
testcase_14 AC 73 ms
71,612 KB
testcase_15 AC 75 ms
71,256 KB
testcase_16 AC 72 ms
71,536 KB
testcase_17 AC 72 ms
71,404 KB
testcase_18 AC 72 ms
71,392 KB
testcase_19 AC 71 ms
71,632 KB
testcase_20 AC 73 ms
71,608 KB
testcase_21 AC 73 ms
71,612 KB
testcase_22 AC 72 ms
71,388 KB
testcase_23 AC 72 ms
71,408 KB
testcase_24 AC 75 ms
71,604 KB
testcase_25 AC 73 ms
71,540 KB
testcase_26 AC 73 ms
71,500 KB
testcase_27 AC 72 ms
71,408 KB
testcase_28 AC 71 ms
71,548 KB
testcase_29 AC 73 ms
71,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    a, b = map(int, input().split())
    if a > b:
        a, b = b, a
    if b <= a + 1:
        print(a + b)
    else:
        print(a * 2 + 1 + (b - a - 1) * 2)


if __name__ == '__main__':
    main()
0