結果

問題 No.1869 Doubling?
ユーザー hir355hir355
提出日時 2022-03-11 21:54:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 71,608 KB
最終ジャッジ日時 2023-10-14 07:00:51
合計ジャッジ時間 5,140 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,552 KB
testcase_01 AC 68 ms
71,320 KB
testcase_02 AC 68 ms
71,204 KB
testcase_03 AC 68 ms
71,608 KB
testcase_04 AC 64 ms
71,256 KB
testcase_05 AC 65 ms
71,544 KB
testcase_06 AC 70 ms
71,084 KB
testcase_07 AC 69 ms
71,332 KB
testcase_08 AC 65 ms
71,492 KB
testcase_09 AC 67 ms
71,320 KB
testcase_10 AC 69 ms
71,468 KB
testcase_11 AC 67 ms
71,376 KB
testcase_12 AC 67 ms
71,232 KB
testcase_13 AC 67 ms
71,336 KB
testcase_14 AC 67 ms
71,264 KB
testcase_15 AC 66 ms
71,236 KB
testcase_16 AC 64 ms
71,240 KB
testcase_17 AC 65 ms
71,428 KB
testcase_18 AC 67 ms
71,100 KB
testcase_19 AC 67 ms
71,400 KB
testcase_20 AC 65 ms
71,324 KB
testcase_21 AC 64 ms
71,432 KB
testcase_22 AC 66 ms
71,376 KB
testcase_23 AC 65 ms
71,304 KB
testcase_24 AC 65 ms
71,404 KB
testcase_25 AC 67 ms
71,316 KB
testcase_26 AC 66 ms
71,364 KB
testcase_27 AC 67 ms
71,432 KB
testcase_28 AC 67 ms
71,236 KB
testcase_29 AC 65 ms
71,236 KB
testcase_30 AC 65 ms
71,384 KB
testcase_31 AC 64 ms
71,472 KB
testcase_32 AC 66 ms
71,236 KB
testcase_33 AC 67 ms
71,252 KB
testcase_34 AC 67 ms
71,096 KB
testcase_35 AC 64 ms
71,252 KB
testcase_36 AC 65 ms
71,240 KB
testcase_37 AC 64 ms
71,236 KB
testcase_38 AC 66 ms
71,240 KB
testcase_39 AC 65 ms
71,592 KB
testcase_40 AC 67 ms
71,236 KB
testcase_41 AC 66 ms
71,340 KB
testcase_42 AC 65 ms
71,520 KB
testcase_43 AC 65 ms
71,364 KB
testcase_44 AC 67 ms
71,328 KB
testcase_45 AC 68 ms
71,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
m -= 1
ans = 0
cnt = 1
while m > 0:
    ans += m
    m //= 2
    cnt += 1
if cnt > n:
    ans = 0
    t = 0
    for i in range(n - 1):
        ans += t
        t = t * 2 + 1
    ans += t
print(ans + n)
0