結果

問題 No.889 素数!
ユーザー tails1434tails1434
提出日時 2019-12-31 20:55:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,025 bytes
コンパイル時間 525 ms
コンパイル使用メモリ 86,716 KB
実行使用メモリ 71,908 KB
最終ジャッジ日時 2023-08-12 22:14:10
合計ジャッジ時間 8,410 ms
ジャッジサーバーID
(参考情報)
judge8 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,700 KB
testcase_01 AC 74 ms
71,712 KB
testcase_02 AC 73 ms
71,764 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 73 ms
71,560 KB
testcase_06 AC 73 ms
71,280 KB
testcase_07 AC 73 ms
71,748 KB
testcase_08 AC 72 ms
71,276 KB
testcase_09 WA -
testcase_10 AC 72 ms
71,908 KB
testcase_11 AC 74 ms
71,836 KB
testcase_12 AC 73 ms
71,552 KB
testcase_13 AC 73 ms
71,664 KB
testcase_14 AC 73 ms
71,476 KB
testcase_15 AC 73 ms
71,724 KB
testcase_16 AC 72 ms
71,720 KB
testcase_17 WA -
testcase_18 AC 73 ms
71,716 KB
testcase_19 AC 73 ms
71,748 KB
testcase_20 AC 76 ms
71,816 KB
testcase_21 AC 73 ms
71,720 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 72 ms
71,764 KB
testcase_25 AC 75 ms
71,760 KB
testcase_26 AC 72 ms
71,328 KB
testcase_27 AC 73 ms
71,832 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 71 ms
71,672 KB
testcase_31 WA -
testcase_32 AC 73 ms
71,548 KB
testcase_33 AC 75 ms
71,656 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 71 ms
71,752 KB
testcase_38 AC 71 ms
71,584 KB
testcase_39 WA -
testcase_40 AC 74 ms
71,484 KB
testcase_41 AC 71 ms
71,732 KB
testcase_42 WA -
testcase_43 AC 73 ms
71,556 KB
testcase_44 WA -
testcase_45 AC 75 ms
71,564 KB
testcase_46 WA -
testcase_47 AC 75 ms
71,756 KB
testcase_48 AC 72 ms
71,728 KB
testcase_49 AC 75 ms
71,352 KB
testcase_50 AC 73 ms
71,644 KB
testcase_51 AC 77 ms
71,756 KB
testcase_52 AC 72 ms
71,476 KB
testcase_53 AC 73 ms
71,656 KB
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 70 ms
71,564 KB
testcase_59 AC 71 ms
71,488 KB
testcase_60 AC 74 ms
71,836 KB
testcase_61 AC 74 ms
71,820 KB
testcase_62 WA -
testcase_63 AC 72 ms
71,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def isprime(N):
    if N == 1:
        return False
    for i in range(2, int(N ** 0.5) + 1):
        if N % i == 0:
            return False
    return True

def issquare(N):
    if N == (N ** 0.5) * (N ** 0.5):
        return True
    return False

def iscubic(N):
    for i in range(int(N ** 0.5) + 1):
        if i ** 3 == N:
            return True

    return False

def isperfect(N):
    ass = []
    for i in range(1, int(N ** 0.5) + 1):
        if N % i == 0:
            ass.append(i)
            if i ** 2 == N:
                continue
            ass.append(N // i)

    tmp = 0
    for a in ass:
        tmp += a
    
    if N == tmp:
        return True

    return False




def main():
    N = int(input())
    if isprime(N):
        print('Sosu!')
        exit()
    if issquare(N):
        print('Heihosu!')
        exit()
    if iscubic(N):
        print('Ripposu!')
        exit()
    if isperfect(N):
        print('Kanzensu!')
        exit()

    print(N)

    



if __name__ == "__main__":
    main()
0