QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 512 MB 總分: 100

#3461. 奇数二项式系数

统计

你可能熟悉二项式系数 $\binom{m}{k}$,其定义为 $\binom{m}{k} = \frac{m!}{k!(m-k)!}$,其中 $m$ 和 $k$ 是非负整数且 $k \le m$。令 $T_2(n)$ 为满足 $0 \le k \le m < n$ 的奇数二项式系数的个数。你在本次比赛中将学到的最有用的数学不等式是 $$0.812556n^{\log_2 3} \le T_2(n) \le n^{\log_2 3}$$ Emma 不喜欢这种不精确的不等式,她想精确地计算出 $T_2(n)$。你能帮帮她吗?

输入格式

输入包含一行,为一个整数 $n$,$1 \le n \le 10^{11}$。

输出格式

输出一行,为 $T_2(n)$ 的值。

样例

样例输入 1

4

样例输出 1

9

样例输入 2

6

样例输出 2

15

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.