結果

問題 No.889 素数!
ユーザー miya145592miya145592
提出日時 2023-05-21 04:25:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 802 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 71,488 KB
最終ジャッジ日時 2023-08-23 12:06:22
合計ジャッジ時間 8,184 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,980 KB
testcase_01 AC 72 ms
71,456 KB
testcase_02 AC 71 ms
71,412 KB
testcase_03 WA -
testcase_04 AC 70 ms
71,304 KB
testcase_05 AC 71 ms
70,976 KB
testcase_06 AC 70 ms
71,360 KB
testcase_07 AC 71 ms
71,236 KB
testcase_08 AC 71 ms
71,032 KB
testcase_09 AC 71 ms
71,396 KB
testcase_10 AC 70 ms
70,904 KB
testcase_11 AC 72 ms
71,048 KB
testcase_12 AC 71 ms
71,104 KB
testcase_13 AC 72 ms
71,108 KB
testcase_14 AC 73 ms
71,124 KB
testcase_15 AC 72 ms
71,316 KB
testcase_16 AC 71 ms
70,908 KB
testcase_17 AC 72 ms
71,108 KB
testcase_18 AC 71 ms
70,908 KB
testcase_19 AC 72 ms
71,092 KB
testcase_20 AC 73 ms
71,300 KB
testcase_21 AC 72 ms
71,104 KB
testcase_22 AC 72 ms
71,172 KB
testcase_23 AC 72 ms
71,308 KB
testcase_24 AC 73 ms
71,268 KB
testcase_25 AC 73 ms
70,912 KB
testcase_26 AC 73 ms
70,904 KB
testcase_27 AC 72 ms
71,132 KB
testcase_28 AC 73 ms
71,168 KB
testcase_29 AC 73 ms
71,428 KB
testcase_30 AC 73 ms
71,312 KB
testcase_31 AC 74 ms
71,240 KB
testcase_32 AC 72 ms
71,320 KB
testcase_33 AC 73 ms
71,312 KB
testcase_34 AC 72 ms
71,108 KB
testcase_35 AC 73 ms
71,388 KB
testcase_36 AC 73 ms
70,976 KB
testcase_37 AC 74 ms
71,264 KB
testcase_38 AC 73 ms
71,400 KB
testcase_39 AC 74 ms
71,224 KB
testcase_40 AC 73 ms
71,164 KB
testcase_41 AC 74 ms
70,996 KB
testcase_42 AC 72 ms
71,108 KB
testcase_43 AC 73 ms
71,304 KB
testcase_44 AC 73 ms
71,048 KB
testcase_45 AC 75 ms
70,892 KB
testcase_46 AC 74 ms
71,268 KB
testcase_47 AC 73 ms
71,316 KB
testcase_48 AC 72 ms
71,204 KB
testcase_49 AC 73 ms
71,380 KB
testcase_50 AC 73 ms
71,436 KB
testcase_51 AC 72 ms
71,472 KB
testcase_52 AC 73 ms
71,048 KB
testcase_53 AC 71 ms
71,388 KB
testcase_54 AC 71 ms
71,320 KB
testcase_55 AC 74 ms
70,912 KB
testcase_56 AC 72 ms
71,264 KB
testcase_57 AC 71 ms
71,184 KB
testcase_58 AC 71 ms
71,176 KB
testcase_59 AC 72 ms
71,104 KB
testcase_60 AC 71 ms
71,244 KB
testcase_61 AC 74 ms
71,256 KB
testcase_62 AC 74 ms
71,048 KB
testcase_63 AC 71 ms
70,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def heiho(n):
    for i in range(2, n+1):
        if i**2>n:
            break
        if i**2==n:
            return 1
    return 0

def rippo(n):
    for i in range(2, n+1):
        if i**3>n:
            break
        if i**3==n:
            return 1
    return 0

N = int(input())
Y = make_divisors(N)
S = sum(Y[:-1])
if N>=2 and len(Y)==2:
    print("Sosu!")
elif N>=2 and heiho(N):
    print("Heihosu!")
elif N>=2 and rippo(N):
    print("Ripposu!")
elif N==S:
    print("Kanzensu!")
else:
    print(N)
0