結果

問題 No.889 素数!
ユーザー y10y10
提出日時 2020-01-12 20:22:57
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 739 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 10,992 KB
実行使用メモリ 46,108 KB
最終ジャッジ日時 2023-08-20 05:47:48
合計ジャッジ時間 11,661 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
29,284 KB
testcase_01 AC 151 ms
46,048 KB
testcase_02 AC 130 ms
29,304 KB
testcase_03 AC 132 ms
29,176 KB
testcase_04 AC 127 ms
29,396 KB
testcase_05 AC 129 ms
29,484 KB
testcase_06 AC 128 ms
29,268 KB
testcase_07 AC 130 ms
29,464 KB
testcase_08 AC 129 ms
29,280 KB
testcase_09 AC 150 ms
45,796 KB
testcase_10 AC 128 ms
29,324 KB
testcase_11 AC 130 ms
29,272 KB
testcase_12 AC 130 ms
29,344 KB
testcase_13 AC 149 ms
45,960 KB
testcase_14 AC 129 ms
29,268 KB
testcase_15 AC 153 ms
46,076 KB
testcase_16 AC 129 ms
29,496 KB
testcase_17 AC 147 ms
45,836 KB
testcase_18 AC 129 ms
29,240 KB
testcase_19 AC 149 ms
45,824 KB
testcase_20 AC 129 ms
29,292 KB
testcase_21 AC 150 ms
45,944 KB
testcase_22 AC 150 ms
45,804 KB
testcase_23 AC 152 ms
45,852 KB
testcase_24 AC 127 ms
29,276 KB
testcase_25 AC 149 ms
46,036 KB
testcase_26 AC 129 ms
29,488 KB
testcase_27 AC 150 ms
45,896 KB
testcase_28 AC 132 ms
29,472 KB
testcase_29 AC 150 ms
45,896 KB
testcase_30 AC 129 ms
29,360 KB
testcase_31 AC 149 ms
45,760 KB
testcase_32 AC 131 ms
29,492 KB
testcase_33 AC 151 ms
45,976 KB
testcase_34 AC 149 ms
45,752 KB
testcase_35 AC 149 ms
45,684 KB
testcase_36 AC 151 ms
45,944 KB
testcase_37 AC 130 ms
29,468 KB
testcase_38 AC 151 ms
46,048 KB
testcase_39 AC 152 ms
45,984 KB
testcase_40 AC 150 ms
45,840 KB
testcase_41 AC 129 ms
29,292 KB
testcase_42 AC 149 ms
45,900 KB
testcase_43 AC 130 ms
29,272 KB
testcase_44 AC 146 ms
45,992 KB
testcase_45 AC 150 ms
45,920 KB
testcase_46 AC 148 ms
46,100 KB
testcase_47 AC 130 ms
29,328 KB
testcase_48 AC 149 ms
45,940 KB
testcase_49 AC 129 ms
29,444 KB
testcase_50 AC 149 ms
45,780 KB
testcase_51 AC 153 ms
45,960 KB
testcase_52 AC 154 ms
45,852 KB
testcase_53 AC 135 ms
29,504 KB
testcase_54 AC 151 ms
45,980 KB
testcase_55 AC 151 ms
45,956 KB
testcase_56 AC 155 ms
45,832 KB
testcase_57 AC 151 ms
45,940 KB
testcase_58 AC 148 ms
46,048 KB
testcase_59 AC 129 ms
29,364 KB
testcase_60 AC 150 ms
46,100 KB
testcase_61 AC 130 ms
29,300 KB
testcase_62 AC 148 ms
46,108 KB
testcase_63 AC 150 ms
45,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import numpy as np

def sosu(n):
    if all(n % i != 0 for i in range(2, n)):
        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