結果

問題 No.1869 Doubling?
ユーザー nasutarou1341nasutarou1341
提出日時 2022-03-11 21:35:54
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 71,516 KB
最終ジャッジ日時 2023-10-14 06:29:05
合計ジャッジ時間 5,658 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,104 KB
testcase_01 AC 75 ms
71,476 KB
testcase_02 AC 77 ms
71,448 KB
testcase_03 AC 77 ms
71,456 KB
testcase_04 AC 79 ms
71,368 KB
testcase_05 AC 77 ms
71,100 KB
testcase_06 AC 78 ms
71,304 KB
testcase_07 AC 76 ms
71,224 KB
testcase_08 AC 78 ms
71,368 KB
testcase_09 AC 77 ms
71,204 KB
testcase_10 AC 79 ms
71,256 KB
testcase_11 AC 78 ms
71,516 KB
testcase_12 AC 76 ms
71,164 KB
testcase_13 AC 76 ms
71,248 KB
testcase_14 AC 78 ms
71,448 KB
testcase_15 AC 77 ms
70,960 KB
testcase_16 AC 76 ms
71,364 KB
testcase_17 AC 76 ms
70,960 KB
testcase_18 AC 79 ms
71,248 KB
testcase_19 AC 77 ms
71,444 KB
testcase_20 AC 78 ms
70,956 KB
testcase_21 AC 77 ms
71,300 KB
testcase_22 AC 77 ms
71,296 KB
testcase_23 AC 79 ms
71,304 KB
testcase_24 AC 78 ms
71,156 KB
testcase_25 AC 78 ms
70,960 KB
testcase_26 AC 78 ms
71,256 KB
testcase_27 AC 78 ms
71,300 KB
testcase_28 AC 78 ms
71,096 KB
testcase_29 AC 79 ms
71,244 KB
testcase_30 AC 78 ms
71,440 KB
testcase_31 AC 76 ms
71,104 KB
testcase_32 AC 80 ms
71,248 KB
testcase_33 AC 76 ms
71,496 KB
testcase_34 AC 76 ms
71,224 KB
testcase_35 AC 76 ms
71,448 KB
testcase_36 AC 78 ms
71,484 KB
testcase_37 AC 79 ms
71,108 KB
testcase_38 AC 77 ms
71,376 KB
testcase_39 AC 76 ms
71,348 KB
testcase_40 AC 77 ms
71,440 KB
testcase_41 AC 76 ms
71,304 KB
testcase_42 AC 76 ms
71,152 KB
testcase_43 AC 76 ms
70,968 KB
testcase_44 AC 75 ms
71,372 KB
testcase_45 AC 74 ms
71,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
cnt = 0
while M != 1:
  ans += M
  if M % 2:
    M += 1
  M >>= 1
  cnt += 1
  
if cnt >= N :
  print((1 << N) - 1)
else:
  print(ans + (N - cnt))
0