結果

問題 No.1860 Magnets
ユーザー ygd.ygd.
提出日時 2022-03-04 21:37:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 71,440 KB
最終ジャッジ日時 2023-09-26 00:18:37
合計ジャッジ時間 4,670 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,328 KB
testcase_01 AC 68 ms
71,380 KB
testcase_02 AC 68 ms
71,416 KB
testcase_03 AC 68 ms
71,440 KB
testcase_04 AC 70 ms
71,380 KB
testcase_05 AC 69 ms
71,400 KB
testcase_06 AC 70 ms
71,432 KB
testcase_07 AC 71 ms
71,192 KB
testcase_08 AC 72 ms
71,380 KB
testcase_09 AC 72 ms
71,420 KB
testcase_10 AC 67 ms
71,048 KB
testcase_11 AC 69 ms
71,416 KB
testcase_12 AC 69 ms
71,380 KB
testcase_13 AC 69 ms
71,408 KB
testcase_14 AC 70 ms
71,368 KB
testcase_15 AC 68 ms
71,200 KB
testcase_16 AC 68 ms
71,280 KB
testcase_17 AC 68 ms
71,240 KB
testcase_18 AC 71 ms
71,416 KB
testcase_19 AC 69 ms
71,268 KB
testcase_20 AC 69 ms
71,328 KB
testcase_21 AC 67 ms
71,404 KB
testcase_22 AC 68 ms
71,400 KB
testcase_23 AC 67 ms
71,240 KB
testcase_24 AC 67 ms
71,032 KB
testcase_25 AC 71 ms
71,172 KB
testcase_26 AC 72 ms
71,268 KB
testcase_27 AC 71 ms
71,192 KB
testcase_28 AC 70 ms
71,416 KB
testcase_29 AC 69 ms
71,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]

def main():
    A,B = map(int,input().split())
    if A == B:
        ans = 2*A
        print(ans);exit()
    if A > B:
        A,B = B,A
    
    ans = 1 + 2*A + (B-A-1) * 2
    print(ans)


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