結果

問題 No.1860 Magnets
ユーザー kept1994kept1994
提出日時 2022-03-19 12:34:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 53,852 KB
最終ジャッジ日時 2024-04-15 01:40:33
合計ジャッジ時間 2,500 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,352 KB
testcase_01 AC 38 ms
52,000 KB
testcase_02 AC 37 ms
52,092 KB
testcase_03 AC 36 ms
51,820 KB
testcase_04 AC 37 ms
52,156 KB
testcase_05 AC 37 ms
52,760 KB
testcase_06 AC 36 ms
52,612 KB
testcase_07 AC 37 ms
53,188 KB
testcase_08 AC 38 ms
52,152 KB
testcase_09 AC 37 ms
53,084 KB
testcase_10 AC 37 ms
52,660 KB
testcase_11 AC 37 ms
52,888 KB
testcase_12 AC 38 ms
52,076 KB
testcase_13 AC 37 ms
53,160 KB
testcase_14 AC 37 ms
53,132 KB
testcase_15 AC 38 ms
52,460 KB
testcase_16 AC 37 ms
53,536 KB
testcase_17 AC 36 ms
52,664 KB
testcase_18 AC 37 ms
52,864 KB
testcase_19 AC 36 ms
52,396 KB
testcase_20 AC 37 ms
53,284 KB
testcase_21 AC 37 ms
53,212 KB
testcase_22 AC 36 ms
53,212 KB
testcase_23 AC 36 ms
52,824 KB
testcase_24 AC 36 ms
52,952 KB
testcase_25 AC 37 ms
53,852 KB
testcase_26 AC 37 ms
52,000 KB
testcase_27 AC 39 ms
53,568 KB
testcase_28 AC 36 ms
52,200 KB
testcase_29 AC 37 ms
53,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

def main():
    x, y = map(int, input().split())
    if x == y:
       print(x + y)
       return
    if x < y:
        x, y = y, x
    rest = x - (y + 1)
    print(y * 2 + 1 + rest * 2)
    return

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