結果

問題 No.889 素数!
ユーザー y10y10
提出日時 2020-01-12 20:36:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 758 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 46,344 KB
最終ジャッジ日時 2023-08-20 06:31:44
合計ジャッジ時間 11,826 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
29,596 KB
testcase_01 AC 155 ms
46,196 KB
testcase_02 AC 134 ms
29,788 KB
testcase_03 AC 139 ms
29,588 KB
testcase_04 AC 134 ms
29,636 KB
testcase_05 AC 134 ms
29,592 KB
testcase_06 AC 134 ms
29,496 KB
testcase_07 AC 134 ms
29,600 KB
testcase_08 AC 135 ms
29,700 KB
testcase_09 AC 154 ms
46,236 KB
testcase_10 AC 131 ms
29,664 KB
testcase_11 AC 131 ms
29,744 KB
testcase_12 AC 130 ms
29,636 KB
testcase_13 AC 154 ms
46,124 KB
testcase_14 AC 135 ms
29,732 KB
testcase_15 AC 156 ms
46,152 KB
testcase_16 AC 133 ms
29,620 KB
testcase_17 AC 154 ms
46,192 KB
testcase_18 AC 133 ms
29,676 KB
testcase_19 AC 156 ms
46,184 KB
testcase_20 AC 135 ms
29,688 KB
testcase_21 AC 153 ms
46,212 KB
testcase_22 AC 159 ms
46,048 KB
testcase_23 AC 163 ms
46,212 KB
testcase_24 AC 134 ms
29,756 KB
testcase_25 AC 155 ms
46,040 KB
testcase_26 AC 134 ms
29,712 KB
testcase_27 AC 156 ms
46,040 KB
testcase_28 AC 135 ms
29,708 KB
testcase_29 AC 154 ms
46,048 KB
testcase_30 AC 143 ms
29,688 KB
testcase_31 AC 164 ms
46,116 KB
testcase_32 AC 135 ms
29,684 KB
testcase_33 AC 155 ms
46,052 KB
testcase_34 AC 153 ms
46,224 KB
testcase_35 AC 153 ms
46,128 KB
testcase_36 AC 154 ms
46,144 KB
testcase_37 AC 133 ms
29,760 KB
testcase_38 AC 155 ms
46,080 KB
testcase_39 AC 155 ms
46,220 KB
testcase_40 AC 156 ms
46,112 KB
testcase_41 AC 133 ms
29,616 KB
testcase_42 AC 156 ms
46,344 KB
testcase_43 AC 136 ms
29,780 KB
testcase_44 AC 153 ms
46,084 KB
testcase_45 AC 153 ms
46,136 KB
testcase_46 AC 153 ms
46,340 KB
testcase_47 AC 134 ms
29,664 KB
testcase_48 AC 155 ms
46,044 KB
testcase_49 AC 134 ms
29,768 KB
testcase_50 AC 162 ms
46,136 KB
testcase_51 AC 159 ms
46,040 KB
testcase_52 AC 160 ms
46,092 KB
testcase_53 AC 138 ms
29,732 KB
testcase_54 AC 163 ms
46,176 KB
testcase_55 AC 162 ms
46,188 KB
testcase_56 AC 161 ms
46,064 KB
testcase_57 AC 159 ms
46,084 KB
testcase_58 AC 159 ms
46,048 KB
testcase_59 AC 137 ms
29,732 KB
testcase_60 AC 160 ms
46,248 KB
testcase_61 AC 137 ms
29,756 KB
testcase_62 AC 156 ms
46,080 KB
testcase_63 AC 157 ms
46,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import numpy as np

def sosu(n):
    x = np.arange(2, int(n**0.5)+1)
    if len(x[n%x==0]) == 0:
        return True
    else:
        return False

def heihosu(n):
    if str(n**0.5)[-1] == "0":
        return True
    else:
        return False

def ripposu(n):
    if str(n**(1/3))[-1] == "0":
        return True
    else:
        return False

def kanzensuu(n):
    U = 10**6 + 100
    x = np.arange(1,U,dtype=np.int64)
    div = x[n%x==0]
    if n == sum(div[:-1]):
        return True
    else:
        return False

n = int(input())
if n == 0 or n == 1:
    print(n)
elif sosu(n):
    print("Sosu!")
elif heihosu(n):
    print("Heihosu!")
elif ripposu(n):
    print("Ripposu!")
elif kanzensuu(n):
    print("Kanzensu!")
else:
    print(n)
0