QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 512 MB Puntuación total: 100 Hackeable ✓

#4274. $2x + 2$

Estadísticas

bobo 有 $n$ 个整数 $1, 2, \dots, n$,并用它们玩一个游戏。 他想选择一个子集 $S \subseteq \{1, 2, \dots, n\}$,使得对于所有的 $x \in S$,都有 $(2x + 2) \notin S$。 他现在对 $S$ 的最大大小很感兴趣。

输入格式

第一行包含一个整数 $n$ ($1 \le n < 10^{100}$)。

输出格式

输出一个整数,表示最大大小。

样例

样例输入 1

4

样例输出 1

3

样例输入 2

1000000000

样例输出 2

666666667

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#168EditorialOpen题解jiangly2025-12-12 23:47:51View

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.