結果

問題 No.1869 Doubling?
ユーザー TsubajiroTsubajiro
提出日時 2022-06-18 16:21:48
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 234 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 62,976 KB
最終ジャッジ日時 2024-04-18 13:45:33
合計ジャッジ時間 11,044 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
57,216 KB
testcase_01 AC 46 ms
57,060 KB
testcase_02 AC 41 ms
51,840 KB
testcase_03 AC 948 ms
57,344 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 AC 42 ms
52,224 KB
testcase_07 AC 41 ms
52,224 KB
testcase_08 AC 41 ms
52,224 KB
testcase_09 WA -
testcase_10 AC 41 ms
51,840 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 43 ms
57,588 KB
testcase_16 AC 46 ms
57,600 KB
testcase_17 AC 45 ms
57,216 KB
testcase_18 AC 41 ms
57,600 KB
testcase_19 AC 44 ms
57,984 KB
testcase_20 AC 47 ms
57,540 KB
testcase_21 AC 46 ms
57,984 KB
testcase_22 AC 45 ms
57,472 KB
testcase_23 AC 46 ms
57,824 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = list(map(int, input().split()))

if N==1:
    print(M)
    exit()

a = M
ans=a
for i in range(N-1):
    if a==0:
        break
    elif a%2==0:
        a//=2
        ans+=a
    else:
        a = a//2+1
        ans+=a

print(ans)
0