結果

問題 No.889 素数!
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-20 09:24:44
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 768 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 72,080 KB
最終ジャッジ日時 2023-07-25 05:04:28
合計ジャッジ時間 7,462 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,752 KB
testcase_01 AC 73 ms
71,544 KB
testcase_02 WA -
testcase_03 AC 77 ms
71,492 KB
testcase_04 AC 77 ms
71,640 KB
testcase_05 AC 78 ms
71,608 KB
testcase_06 AC 76 ms
71,700 KB
testcase_07 WA -
testcase_08 AC 76 ms
71,760 KB
testcase_09 AC 74 ms
71,756 KB
testcase_10 AC 77 ms
71,496 KB
testcase_11 AC 76 ms
71,912 KB
testcase_12 WA -
testcase_13 AC 77 ms
71,840 KB
testcase_14 AC 77 ms
71,544 KB
testcase_15 AC 77 ms
71,908 KB
testcase_16 AC 74 ms
71,760 KB
testcase_17 AC 76 ms
71,860 KB
testcase_18 WA -
testcase_19 AC 78 ms
71,940 KB
testcase_20 AC 77 ms
71,688 KB
testcase_21 AC 78 ms
71,752 KB
testcase_22 AC 76 ms
71,648 KB
testcase_23 AC 76 ms
71,948 KB
testcase_24 AC 81 ms
71,784 KB
testcase_25 AC 78 ms
71,748 KB
testcase_26 WA -
testcase_27 AC 77 ms
71,688 KB
testcase_28 AC 76 ms
71,604 KB
testcase_29 AC 76 ms
71,696 KB
testcase_30 AC 78 ms
72,036 KB
testcase_31 AC 75 ms
71,924 KB
testcase_32 AC 78 ms
71,488 KB
testcase_33 AC 78 ms
71,496 KB
testcase_34 AC 78 ms
71,828 KB
testcase_35 AC 76 ms
71,812 KB
testcase_36 AC 75 ms
71,552 KB
testcase_37 AC 77 ms
71,708 KB
testcase_38 AC 75 ms
72,036 KB
testcase_39 AC 75 ms
71,496 KB
testcase_40 AC 74 ms
71,832 KB
testcase_41 AC 74 ms
71,692 KB
testcase_42 AC 75 ms
71,864 KB
testcase_43 AC 76 ms
71,712 KB
testcase_44 AC 77 ms
71,944 KB
testcase_45 AC 79 ms
71,892 KB
testcase_46 AC 77 ms
71,468 KB
testcase_47 AC 76 ms
71,804 KB
testcase_48 AC 77 ms
71,492 KB
testcase_49 WA -
testcase_50 AC 78 ms
71,748 KB
testcase_51 AC 77 ms
71,608 KB
testcase_52 AC 77 ms
71,844 KB
testcase_53 AC 76 ms
71,952 KB
testcase_54 AC 76 ms
71,944 KB
testcase_55 AC 77 ms
71,540 KB
testcase_56 AC 75 ms
71,704 KB
testcase_57 AC 76 ms
71,772 KB
testcase_58 AC 77 ms
72,036 KB
testcase_59 AC 77 ms
71,636 KB
testcase_60 AC 75 ms
72,080 KB
testcase_61 AC 77 ms
71,636 KB
testcase_62 AC 77 ms
71,832 KB
testcase_63 AC 78 ms
71,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
L = [0]*64

import math

def is_prime(n):
    if n == 1:
        return False

    for i in range(2, int(math.sqrt(n))+1):
        if n%i == 0:
            return False

    return True

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(reverse=True)
    return divisors

for i in range(2, 64):
    d = make_divisors(i)
    if sum(d)-i == i:
        L[i] = 'Kanzensu!'

for i in range(2, 4):
    L[i**3] = 'Ripposu!'

for i in range(2, 8):
    L[i**2] = 'Heihousu!'

for i in range(1, 64):
    if is_prime(i):
        L[i] = 'Sosu!'

if L[n] != 0:
    print(L[n])
else:
    print(n)
0