結果

問題 No.889 素数!
ユーザー dangodango
提出日時 2023-06-07 21:20:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 837 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 71,952 KB
最終ジャッジ日時 2023-08-28 18:30:40
合計ジャッジ時間 6,710 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,696 KB
testcase_01 AC 67 ms
71,512 KB
testcase_02 AC 66 ms
71,448 KB
testcase_03 AC 71 ms
71,132 KB
testcase_04 AC 66 ms
70,988 KB
testcase_05 AC 67 ms
71,516 KB
testcase_06 AC 66 ms
71,852 KB
testcase_07 AC 67 ms
71,808 KB
testcase_08 AC 66 ms
71,948 KB
testcase_09 WA -
testcase_10 AC 67 ms
71,816 KB
testcase_11 AC 68 ms
71,512 KB
testcase_12 AC 68 ms
71,916 KB
testcase_13 AC 69 ms
71,368 KB
testcase_14 AC 67 ms
71,512 KB
testcase_15 AC 68 ms
71,368 KB
testcase_16 AC 68 ms
71,816 KB
testcase_17 AC 67 ms
71,508 KB
testcase_18 AC 66 ms
71,884 KB
testcase_19 AC 66 ms
71,680 KB
testcase_20 AC 67 ms
71,304 KB
testcase_21 AC 68 ms
71,804 KB
testcase_22 AC 66 ms
71,740 KB
testcase_23 AC 68 ms
71,472 KB
testcase_24 AC 68 ms
71,452 KB
testcase_25 AC 67 ms
71,744 KB
testcase_26 AC 67 ms
71,856 KB
testcase_27 AC 67 ms
71,592 KB
testcase_28 AC 67 ms
71,504 KB
testcase_29 WA -
testcase_30 AC 67 ms
71,792 KB
testcase_31 AC 66 ms
71,704 KB
testcase_32 AC 68 ms
71,640 KB
testcase_33 AC 67 ms
71,444 KB
testcase_34 AC 67 ms
71,800 KB
testcase_35 AC 67 ms
71,952 KB
testcase_36 AC 67 ms
71,636 KB
testcase_37 AC 67 ms
71,856 KB
testcase_38 AC 67 ms
71,744 KB
testcase_39 AC 66 ms
71,720 KB
testcase_40 AC 67 ms
71,532 KB
testcase_41 AC 67 ms
71,508 KB
testcase_42 AC 66 ms
71,680 KB
testcase_43 AC 67 ms
71,696 KB
testcase_44 AC 66 ms
71,916 KB
testcase_45 AC 67 ms
71,632 KB
testcase_46 AC 67 ms
71,584 KB
testcase_47 AC 68 ms
71,944 KB
testcase_48 AC 67 ms
71,800 KB
testcase_49 AC 67 ms
71,492 KB
testcase_50 AC 66 ms
71,692 KB
testcase_51 AC 66 ms
71,640 KB
testcase_52 AC 66 ms
71,860 KB
testcase_53 AC 67 ms
71,904 KB
testcase_54 AC 68 ms
71,744 KB
testcase_55 AC 67 ms
71,604 KB
testcase_56 AC 68 ms
71,856 KB
testcase_57 AC 67 ms
71,360 KB
testcase_58 AC 71 ms
71,508 KB
testcase_59 AC 67 ms
71,632 KB
testcase_60 AC 68 ms
71,692 KB
testcase_61 AC 66 ms
71,880 KB
testcase_62 AC 66 ms
71,604 KB
testcase_63 AC 66 ms
71,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def ISPRIME(N):
    if N < 2:
        return False
    elif N == 2:
        return True
    elif N % 2 == 0:
        return False
    else:
        for i in range(3, int(N ** 0.5) + 1):
            if N % i == 0:
                return False
    return True

def ISSQUARE(N):
    return float(N ** 0.5).is_integer()

def ISCUBIC(N):
    return float(N ** (1 / 3)).is_integer()

def ISPERFECT(N):
    divisors = []
    for i in range(1, N + 1):
        if N % i == 0:
            divisors.append(N)
            divisors.append(int(N / i))
    return sum(list(set(divisors))[0:len(list(set(divisors))) - 1]) == N

N = int(input())
if N == 0 or N == 1:
  print(N)
elif ISPRIME(N):
    print("Sosu!")
elif ISSQUARE(N):
    print("Heihosu!")
elif ISCUBIC(N):
    print("Ripposu!")
elif ISPERFECT(N):
    print("Kanzensu!")
else:
    print(N)
0