結果

問題 No.889 素数!
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-20 09:29:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 767 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 54,608 KB
最終ジャッジ日時 2024-04-09 22:50:11
合計ジャッジ時間 4,150 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,592 KB
testcase_01 AC 37 ms
53,176 KB
testcase_02 AC 38 ms
54,208 KB
testcase_03 AC 38 ms
52,856 KB
testcase_04 AC 39 ms
53,324 KB
testcase_05 AC 37 ms
53,060 KB
testcase_06 AC 39 ms
52,972 KB
testcase_07 AC 38 ms
53,956 KB
testcase_08 AC 37 ms
53,768 KB
testcase_09 AC 37 ms
53,652 KB
testcase_10 AC 37 ms
53,584 KB
testcase_11 AC 36 ms
54,084 KB
testcase_12 AC 38 ms
53,876 KB
testcase_13 AC 38 ms
53,692 KB
testcase_14 AC 37 ms
53,256 KB
testcase_15 AC 37 ms
52,980 KB
testcase_16 AC 37 ms
53,128 KB
testcase_17 AC 37 ms
53,280 KB
testcase_18 AC 38 ms
53,676 KB
testcase_19 AC 37 ms
53,924 KB
testcase_20 AC 38 ms
53,152 KB
testcase_21 AC 39 ms
53,148 KB
testcase_22 AC 37 ms
54,468 KB
testcase_23 AC 38 ms
53,972 KB
testcase_24 AC 38 ms
53,520 KB
testcase_25 AC 37 ms
53,400 KB
testcase_26 AC 38 ms
53,764 KB
testcase_27 AC 38 ms
52,724 KB
testcase_28 AC 37 ms
53,200 KB
testcase_29 AC 38 ms
53,672 KB
testcase_30 AC 38 ms
52,768 KB
testcase_31 AC 37 ms
53,408 KB
testcase_32 AC 40 ms
53,628 KB
testcase_33 AC 42 ms
52,728 KB
testcase_34 AC 40 ms
52,764 KB
testcase_35 AC 38 ms
54,256 KB
testcase_36 AC 38 ms
52,848 KB
testcase_37 AC 37 ms
53,792 KB
testcase_38 AC 37 ms
53,396 KB
testcase_39 AC 37 ms
54,348 KB
testcase_40 AC 37 ms
54,488 KB
testcase_41 AC 38 ms
53,380 KB
testcase_42 AC 37 ms
54,356 KB
testcase_43 AC 37 ms
53,608 KB
testcase_44 AC 37 ms
53,688 KB
testcase_45 AC 37 ms
53,672 KB
testcase_46 AC 39 ms
53,308 KB
testcase_47 AC 37 ms
53,360 KB
testcase_48 AC 37 ms
53,696 KB
testcase_49 AC 37 ms
53,008 KB
testcase_50 AC 37 ms
53,412 KB
testcase_51 AC 40 ms
54,008 KB
testcase_52 AC 37 ms
52,844 KB
testcase_53 AC 37 ms
53,464 KB
testcase_54 AC 36 ms
53,312 KB
testcase_55 AC 38 ms
53,928 KB
testcase_56 AC 38 ms
54,608 KB
testcase_57 AC 38 ms
53,520 KB
testcase_58 AC 38 ms
53,192 KB
testcase_59 AC 37 ms
53,828 KB
testcase_60 AC 37 ms
54,176 KB
testcase_61 AC 36 ms
53,340 KB
testcase_62 AC 41 ms
52,848 KB
testcase_63 AC 41 ms
54,360 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] = 'Heihosu!'

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

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