結果

問題 No.1869 Doubling?
ユーザー horitaka1999horitaka1999
提出日時 2022-03-11 22:22:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 71,672 KB
最終ジャッジ日時 2023-10-14 07:35:20
合計ジャッジ時間 5,060 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,132 KB
testcase_01 AC 63 ms
71,368 KB
testcase_02 AC 63 ms
71,368 KB
testcase_03 AC 64 ms
71,604 KB
testcase_04 AC 63 ms
71,328 KB
testcase_05 AC 64 ms
71,344 KB
testcase_06 AC 63 ms
71,132 KB
testcase_07 AC 63 ms
71,324 KB
testcase_08 AC 63 ms
71,672 KB
testcase_09 AC 63 ms
71,180 KB
testcase_10 AC 63 ms
71,392 KB
testcase_11 AC 64 ms
71,264 KB
testcase_12 AC 63 ms
71,164 KB
testcase_13 AC 64 ms
71,508 KB
testcase_14 AC 62 ms
71,168 KB
testcase_15 AC 66 ms
71,284 KB
testcase_16 AC 65 ms
71,360 KB
testcase_17 AC 66 ms
71,624 KB
testcase_18 AC 65 ms
71,508 KB
testcase_19 AC 66 ms
71,264 KB
testcase_20 AC 65 ms
71,316 KB
testcase_21 AC 63 ms
71,572 KB
testcase_22 AC 64 ms
71,320 KB
testcase_23 AC 64 ms
71,296 KB
testcase_24 AC 65 ms
71,340 KB
testcase_25 AC 65 ms
71,368 KB
testcase_26 AC 66 ms
71,144 KB
testcase_27 AC 64 ms
71,508 KB
testcase_28 AC 64 ms
71,168 KB
testcase_29 AC 64 ms
71,300 KB
testcase_30 AC 66 ms
71,416 KB
testcase_31 AC 62 ms
71,284 KB
testcase_32 AC 66 ms
71,204 KB
testcase_33 AC 64 ms
71,328 KB
testcase_34 AC 64 ms
71,444 KB
testcase_35 AC 64 ms
71,200 KB
testcase_36 AC 64 ms
71,336 KB
testcase_37 AC 64 ms
71,300 KB
testcase_38 AC 65 ms
71,200 KB
testcase_39 AC 63 ms
71,360 KB
testcase_40 AC 64 ms
71,392 KB
testcase_41 AC 65 ms
71,328 KB
testcase_42 AC 64 ms
71,296 KB
testcase_43 AC 66 ms
71,368 KB
testcase_44 AC 63 ms
71,176 KB
testcase_45 AC 61 ms
71,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
tmp = 1
flag = True
for i in range(1,N):
    tmp *= 2
    if tmp > M:
        flag = False
        break
if flag:
    print(2**N -1)
else:
    List = [M]
    while len(List) < N:
        nx = (List[-1] + 1)//2
        List.append(nx)
        if nx == 1:
            break
    ans = sum(List) + N-len(List)
    print(ans)
0