結果

問題 No.1869 Doubling?
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-03-11 21:51:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 71,588 KB
最終ジャッジ日時 2023-10-14 06:58:12
合計ジャッジ時間 5,084 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,352 KB
testcase_01 AC 66 ms
71,296 KB
testcase_02 AC 66 ms
71,440 KB
testcase_03 AC 64 ms
71,060 KB
testcase_04 AC 71 ms
71,372 KB
testcase_05 AC 64 ms
71,068 KB
testcase_06 AC 64 ms
71,284 KB
testcase_07 AC 66 ms
71,368 KB
testcase_08 AC 65 ms
71,016 KB
testcase_09 AC 65 ms
71,444 KB
testcase_10 AC 68 ms
71,572 KB
testcase_11 AC 68 ms
71,076 KB
testcase_12 AC 68 ms
71,264 KB
testcase_13 AC 66 ms
71,372 KB
testcase_14 AC 65 ms
71,204 KB
testcase_15 AC 65 ms
71,296 KB
testcase_16 AC 69 ms
71,300 KB
testcase_17 AC 66 ms
71,324 KB
testcase_18 AC 66 ms
71,284 KB
testcase_19 AC 67 ms
71,520 KB
testcase_20 AC 69 ms
71,304 KB
testcase_21 AC 67 ms
71,424 KB
testcase_22 AC 65 ms
71,504 KB
testcase_23 AC 65 ms
71,220 KB
testcase_24 AC 67 ms
71,380 KB
testcase_25 AC 66 ms
71,080 KB
testcase_26 AC 63 ms
71,404 KB
testcase_27 AC 68 ms
71,488 KB
testcase_28 AC 69 ms
71,228 KB
testcase_29 AC 66 ms
71,516 KB
testcase_30 AC 68 ms
71,064 KB
testcase_31 AC 67 ms
71,420 KB
testcase_32 AC 66 ms
71,236 KB
testcase_33 AC 67 ms
71,392 KB
testcase_34 AC 66 ms
71,568 KB
testcase_35 AC 68 ms
71,444 KB
testcase_36 AC 68 ms
71,224 KB
testcase_37 AC 70 ms
71,084 KB
testcase_38 AC 67 ms
71,220 KB
testcase_39 AC 68 ms
71,064 KB
testcase_40 AC 64 ms
71,180 KB
testcase_41 AC 66 ms
71,224 KB
testcase_42 AC 67 ms
71,224 KB
testcase_43 AC 68 ms
71,252 KB
testcase_44 AC 66 ms
71,588 KB
testcase_45 AC 68 ms
71,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
ans = 1
now = 1
ok = True
for i in range(n-1):
    now *= 2
    if now > m:
        ok = False
        break
    ans += now
if ok:
    print(ans)
    exit()

ans = m
now = m
for i in range(n-1):
    now = (now+1)//2
    ans += now
    if now == 1:
        print(ans+(n-2-i))
        exit()

print(ans)
0