結果

問題 No.889 素数!
ユーザー stngstng
提出日時 2022-08-06 17:04:58
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 868 bytes
コンパイル時間 2,309 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 78,920 KB
最終ジャッジ日時 2023-10-14 17:42:28
合計ジャッジ時間 8,014 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,676 KB
testcase_01 AC 63 ms
72,040 KB
testcase_02 AC 61 ms
71,576 KB
testcase_03 RE -
testcase_04 AC 64 ms
71,364 KB
testcase_05 AC 63 ms
71,924 KB
testcase_06 AC 63 ms
71,684 KB
testcase_07 AC 64 ms
71,700 KB
testcase_08 AC 62 ms
71,556 KB
testcase_09 AC 62 ms
71,736 KB
testcase_10 AC 63 ms
71,652 KB
testcase_11 AC 67 ms
71,592 KB
testcase_12 AC 64 ms
72,012 KB
testcase_13 AC 63 ms
71,948 KB
testcase_14 AC 63 ms
71,676 KB
testcase_15 AC 62 ms
71,896 KB
testcase_16 AC 63 ms
71,792 KB
testcase_17 AC 61 ms
71,396 KB
testcase_18 AC 62 ms
72,112 KB
testcase_19 AC 62 ms
71,696 KB
testcase_20 AC 66 ms
71,828 KB
testcase_21 AC 63 ms
72,044 KB
testcase_22 AC 64 ms
71,592 KB
testcase_23 AC 67 ms
71,668 KB
testcase_24 AC 63 ms
71,496 KB
testcase_25 AC 60 ms
71,948 KB
testcase_26 AC 63 ms
71,668 KB
testcase_27 AC 64 ms
71,952 KB
testcase_28 AC 64 ms
71,792 KB
testcase_29 AC 66 ms
71,532 KB
testcase_30 AC 67 ms
71,736 KB
testcase_31 AC 63 ms
72,000 KB
testcase_32 AC 64 ms
71,560 KB
testcase_33 AC 64 ms
71,736 KB
testcase_34 AC 63 ms
71,940 KB
testcase_35 AC 66 ms
71,944 KB
testcase_36 AC 64 ms
71,704 KB
testcase_37 AC 65 ms
71,920 KB
testcase_38 AC 66 ms
71,784 KB
testcase_39 AC 64 ms
71,796 KB
testcase_40 AC 64 ms
72,040 KB
testcase_41 AC 64 ms
71,596 KB
testcase_42 AC 65 ms
71,968 KB
testcase_43 AC 65 ms
71,900 KB
testcase_44 AC 64 ms
71,700 KB
testcase_45 AC 66 ms
71,788 KB
testcase_46 AC 64 ms
71,892 KB
testcase_47 AC 63 ms
72,152 KB
testcase_48 AC 63 ms
71,696 KB
testcase_49 AC 63 ms
71,628 KB
testcase_50 AC 65 ms
72,132 KB
testcase_51 AC 64 ms
71,396 KB
testcase_52 AC 62 ms
71,812 KB
testcase_53 AC 63 ms
71,664 KB
testcase_54 AC 63 ms
72,012 KB
testcase_55 AC 64 ms
71,872 KB
testcase_56 AC 65 ms
71,684 KB
testcase_57 AC 66 ms
71,884 KB
testcase_58 AC 65 ms
71,396 KB
testcase_59 AC 63 ms
71,668 KB
testcase_60 AC 71 ms
71,796 KB
testcase_61 AC 65 ms
71,948 KB
testcase_62 AC 60 ms
71,860 KB
testcase_63 AC 65 ms
71,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def sieve_of_eratosthenes(n):
    prime = [True for i in range(n+1)]
    prime[0] = False
    prime[1] = False

    sqrt_n = math.ceil(math.sqrt(n))
    for i in range(2, sqrt_n):
        if prime[i]:
            for j in range(2*i, n+1, i):
                prime[j] = False

    return prime

n = int(input())
hei = [(i+1)**2 for i in range(1,7)]
rip = [(i+1)**3 for i in range(1,3)]

pri = sieve_of_eratosthenes(n)
div = make_divisors(n)
if n in hei:
    print("Heihosu!")
elif n in rip:
    print("Ripposu!")
elif pri[n] == True:
    print("Sosu!")
elif sum(div)-n == n:
    print("Kanzensu!")
else:
    print(n)
0