QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 64 MB Points totaux : 100

#11582. 它会停止吗?

Statistiques

Byteasar 在华沙大学的图书馆附近漫步时,在其中一面外墙上发现了一段程序,上面写着“它会停止吗?”(“Will it stop?”)。这个问题看起来很有趣,于是 Byteasar 回家后尝试解决它。不幸的是,他在抄写这段代码时犯了一个错误,记成了:

while n > 1 do
    if n mod 2 = 0 then
        n := n / 2
    else
        n := 3 * n + 3

Byteasar 现在试图弄清楚,对于变量 $n$ 的哪些初始值,他写下的这段程序会停止。我们假设变量 $n$ 的大小没有限制,即它可以达到任意大的值。

输入格式

输入的第一行也是唯一一行包含一个整数 $n$ ($2 \leqslant n \leqslant 10^{14}$)。

输出格式

在第一行也是唯一一行输出中,如果程序对于给定的 $n$ 值会停止,则输出单词 TAK(波兰语中的“是”),否则输出 NIE(波兰语中的“否”)。

样例

样例输入 1

4

样例输出 1

TAK

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.