結果

問題 No.889 素数!
ユーザー fV9TwBhUoa9S3eV
提出日時 2019-10-30 15:31:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-14 21:53:16
合計ジャッジ時間 3,622 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

# No.889 素数!
n = int(input())

if n < 2:
    print(n)
elif n ** (1 / 2) == int(n ** (1 / 2)):
    print('Heihosu!')
elif n ** (1 / 3) == int(n ** (1 / 3)):
    print('Ripposu!')
else: 
    divisors = []
    for i in range(1, n):
        if n % i == 0:
            divisors.append(i)
    if sum(divisors) == n:
        print('Kanzensu!')
    elif len(divisors) == 1:
        print('Sosu!')
    else:
        print(n)
0