問題一覧 > 通常問題

No.889 Prime Number!

レベル : / AI推定難易度 : 167 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 363
作問者 : trineutron / テスター : face4
お気に入りにしたユーザー ProblemId : 3147 / 自分の提出
問題文最終更新日: 2022-04-26 01:55:03
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 224 (順位表) の他の問題:

Problem Statement

In a certain choir, there is a custom that after practice, the number of days remaining until the concert is announced, and the members respond to it.

The responses are as follows.
If the number of remaining days is a prime number: Sosu!
If the number of remaining days is a perfect square of at least $2$: Heihosu!
If the number of remaining days is a perfect cube of at least $2$: Ripposu!
If the number of remaining days is a perfect number: Kanzensu!

The number of remaining days $N$ is given as input. If the response is determined, output that response; otherwise, output $N$ as is.

Here, a prime number is a natural number of at least $2$ whose only positive divisors are $1$ and itself, a perfect square is an integer that is the $2$nd power of some integer, a perfect cube is an integer that is the $3$rd power of some integer, and a perfect number is a natural number for which the sum of its positive divisors excluding itself equals itself.

Input

$N$

$N$ is an integer
$0 \le N \lt 64$

Output

If the input $N$ has a determined response, output that response; if the response is not determined, output $N$. Print a newline at the end.

Sample

Sample 1
Input
17
Output
Sosu!

Sample 2
Input
15
Output
15

Sample 3
Input
36
Output
Heihosu!

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。