結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,780 KB
testcase_01 AC 77 ms
71,764 KB
testcase_02 WA -
testcase_03 AC 77 ms
71,748 KB
testcase_04 AC 79 ms
72,120 KB
testcase_05 AC 76 ms
71,900 KB
testcase_06 AC 76 ms
71,976 KB
testcase_07 WA -
testcase_08 AC 76 ms
71,732 KB
testcase_09 AC 78 ms
71,876 KB
testcase_10 AC 76 ms
72,036 KB
testcase_11 AC 76 ms
71,664 KB
testcase_12 WA -
testcase_13 AC 78 ms
71,940 KB
testcase_14 AC 77 ms
72,100 KB
testcase_15 AC 78 ms
71,780 KB
testcase_16 AC 77 ms
71,504 KB
testcase_17 AC 78 ms
71,776 KB
testcase_18 WA -
testcase_19 AC 81 ms
72,004 KB
testcase_20 AC 80 ms
71,748 KB
testcase_21 AC 78 ms
72,224 KB
testcase_22 AC 81 ms
71,940 KB
testcase_23 AC 81 ms
71,836 KB
testcase_24 AC 79 ms
71,756 KB
testcase_25 AC 78 ms
71,948 KB
testcase_26 WA -
testcase_27 AC 77 ms
71,780 KB
testcase_28 AC 79 ms
71,552 KB
testcase_29 AC 77 ms
72,036 KB
testcase_30 AC 80 ms
72,132 KB
testcase_31 AC 80 ms
71,776 KB
testcase_32 AC 79 ms
71,868 KB
testcase_33 AC 78 ms
71,728 KB
testcase_34 AC 79 ms
72,032 KB
testcase_35 AC 79 ms
71,928 KB
testcase_36 AC 80 ms
71,828 KB
testcase_37 AC 79 ms
71,936 KB
testcase_38 AC 77 ms
72,056 KB
testcase_39 AC 78 ms
71,944 KB
testcase_40 AC 76 ms
71,700 KB
testcase_41 AC 78 ms
71,948 KB
testcase_42 AC 80 ms
71,944 KB
testcase_43 AC 81 ms
71,896 KB
testcase_44 AC 79 ms
71,776 KB
testcase_45 AC 80 ms
71,544 KB
testcase_46 AC 80 ms
71,572 KB
testcase_47 AC 79 ms
71,932 KB
testcase_48 AC 83 ms
71,744 KB
testcase_49 WA -
testcase_50 AC 78 ms
71,900 KB
testcase_51 AC 76 ms
71,600 KB
testcase_52 AC 77 ms
71,700 KB
testcase_53 AC 79 ms
71,932 KB
testcase_54 AC 79 ms
71,860 KB
testcase_55 AC 76 ms
71,700 KB
testcase_56 AC 77 ms
71,956 KB
testcase_57 AC 78 ms
71,704 KB
testcase_58 AC 79 ms
71,980 KB
testcase_59 AC 81 ms
71,904 KB
testcase_60 AC 79 ms
71,696 KB
testcase_61 AC 80 ms
72,096 KB
testcase_62 AC 79 ms
71,900 KB
testcase_63 AC 79 ms
71,748 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(64):
    if i == 0:
        continue
    else:
        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(64):
    if i == 0:
        continue
    else:
        if is_prime(i):
            L[i] = 'Sosu!'

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