結果

問題 No.889 素数!
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-20 09:24:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 768 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 55,160 KB
最終ジャッジ日時 2024-04-09 22:50:02
合計ジャッジ時間 4,065 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,632 KB
testcase_01 AC 36 ms
54,104 KB
testcase_02 WA -
testcase_03 AC 35 ms
53,340 KB
testcase_04 AC 37 ms
53,272 KB
testcase_05 AC 35 ms
53,216 KB
testcase_06 AC 36 ms
53,156 KB
testcase_07 WA -
testcase_08 AC 36 ms
53,300 KB
testcase_09 AC 36 ms
53,296 KB
testcase_10 AC 36 ms
53,128 KB
testcase_11 AC 37 ms
52,772 KB
testcase_12 WA -
testcase_13 AC 36 ms
53,464 KB
testcase_14 AC 37 ms
53,592 KB
testcase_15 AC 36 ms
52,580 KB
testcase_16 AC 36 ms
52,964 KB
testcase_17 AC 37 ms
53,028 KB
testcase_18 WA -
testcase_19 AC 37 ms
53,680 KB
testcase_20 AC 37 ms
53,328 KB
testcase_21 AC 35 ms
53,636 KB
testcase_22 AC 37 ms
53,736 KB
testcase_23 AC 37 ms
54,492 KB
testcase_24 AC 37 ms
52,876 KB
testcase_25 AC 37 ms
52,720 KB
testcase_26 WA -
testcase_27 AC 36 ms
53,140 KB
testcase_28 AC 36 ms
52,900 KB
testcase_29 AC 36 ms
53,860 KB
testcase_30 AC 37 ms
54,408 KB
testcase_31 AC 37 ms
53,112 KB
testcase_32 AC 37 ms
53,184 KB
testcase_33 AC 37 ms
53,736 KB
testcase_34 AC 36 ms
53,256 KB
testcase_35 AC 36 ms
53,528 KB
testcase_36 AC 36 ms
53,752 KB
testcase_37 AC 36 ms
54,240 KB
testcase_38 AC 36 ms
52,724 KB
testcase_39 AC 37 ms
52,788 KB
testcase_40 AC 36 ms
54,380 KB
testcase_41 AC 36 ms
53,944 KB
testcase_42 AC 37 ms
53,284 KB
testcase_43 AC 36 ms
53,744 KB
testcase_44 AC 36 ms
54,004 KB
testcase_45 AC 36 ms
54,176 KB
testcase_46 AC 37 ms
53,400 KB
testcase_47 AC 36 ms
53,620 KB
testcase_48 AC 37 ms
52,860 KB
testcase_49 WA -
testcase_50 AC 37 ms
53,128 KB
testcase_51 AC 37 ms
52,856 KB
testcase_52 AC 36 ms
54,040 KB
testcase_53 AC 36 ms
53,344 KB
testcase_54 AC 36 ms
53,264 KB
testcase_55 AC 35 ms
53,252 KB
testcase_56 AC 36 ms
53,408 KB
testcase_57 AC 36 ms
53,392 KB
testcase_58 AC 37 ms
54,312 KB
testcase_59 AC 37 ms
54,288 KB
testcase_60 AC 36 ms
53,928 KB
testcase_61 AC 36 ms
53,060 KB
testcase_62 AC 36 ms
53,188 KB
testcase_63 AC 37 ms
52,992 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