QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#14215. 熊猫宝宝

Statistics

一只打喷嚏的大熊猫宝宝

Alex 正在照顾一只似乎异常爱流鼻涕的大熊猫宝宝。每天,大熊猫宝宝可能会在它的围栏里打喷嚏吐出零个或一个史莱姆;每天晚上,围栏里现有的所有史莱姆都会分裂,使得史莱姆的数量在夜间翻倍。在第 1 天开始时,Alex 将大熊猫宝宝放入一个没有任何史莱姆(0 个史莱姆)的干净围栏中,并观察到在第 $n$ 天晚上结束时,大熊猫宝宝的围栏里有 $m$ 个史莱姆。她很担心大熊猫宝宝,想知道在这 $n$ 天里,大熊猫宝宝打喷嚏吐出史莱姆的次数。

输入格式

输入仅包含一行,为两个空格分隔的整数 $n, m$($1 \le n \le 10^{18}$,$0 \le m \le 10^{18}$,$m$ 为偶数),其中 $n$ 表示天数,$m$ 表示第 $n$ 天晚上之后围栏里的史莱姆数量。

输出格式

输出一行,表示大熊猫宝宝打喷嚏吐出史莱姆的次数。

样例

输入样例 1

10 10

输出样例 1

2

输入样例 2

10 128

输出样例 2

1

输入样例 3

13 500

输出样例 3

6

输入样例 4

1000000000000000000 576460752303423488

输出样例 4

1

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.