結果

問題 No.889 素数!
ユーザー tails1434tails1434
提出日時 2019-12-31 21:02:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 1,060 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 71,792 KB
最終ジャッジ日時 2023-08-12 22:29:49
合計ジャッジ時間 7,577 ms
ジャッジサーバーID
(参考情報)
judge2 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,520 KB
testcase_01 AC 73 ms
71,768 KB
testcase_02 AC 73 ms
71,668 KB
testcase_03 AC 73 ms
71,264 KB
testcase_04 AC 74 ms
71,128 KB
testcase_05 AC 74 ms
71,392 KB
testcase_06 AC 77 ms
71,392 KB
testcase_07 AC 73 ms
71,696 KB
testcase_08 AC 71 ms
71,508 KB
testcase_09 AC 74 ms
71,788 KB
testcase_10 AC 72 ms
71,548 KB
testcase_11 AC 74 ms
71,612 KB
testcase_12 AC 75 ms
71,656 KB
testcase_13 AC 75 ms
71,556 KB
testcase_14 AC 73 ms
71,492 KB
testcase_15 AC 72 ms
71,392 KB
testcase_16 AC 75 ms
71,560 KB
testcase_17 AC 74 ms
71,392 KB
testcase_18 AC 73 ms
71,508 KB
testcase_19 AC 72 ms
71,560 KB
testcase_20 AC 72 ms
71,724 KB
testcase_21 AC 73 ms
71,428 KB
testcase_22 AC 73 ms
71,356 KB
testcase_23 AC 76 ms
71,740 KB
testcase_24 AC 75 ms
71,436 KB
testcase_25 AC 73 ms
71,792 KB
testcase_26 AC 74 ms
71,548 KB
testcase_27 AC 73 ms
71,548 KB
testcase_28 AC 74 ms
71,472 KB
testcase_29 AC 74 ms
71,792 KB
testcase_30 AC 72 ms
71,388 KB
testcase_31 AC 74 ms
71,540 KB
testcase_32 AC 73 ms
71,532 KB
testcase_33 AC 74 ms
71,748 KB
testcase_34 AC 75 ms
71,520 KB
testcase_35 AC 75 ms
71,536 KB
testcase_36 AC 74 ms
71,388 KB
testcase_37 AC 72 ms
71,732 KB
testcase_38 AC 72 ms
71,668 KB
testcase_39 AC 71 ms
71,720 KB
testcase_40 AC 73 ms
71,552 KB
testcase_41 AC 73 ms
71,508 KB
testcase_42 AC 76 ms
71,788 KB
testcase_43 AC 73 ms
71,508 KB
testcase_44 AC 75 ms
71,696 KB
testcase_45 AC 72 ms
71,688 KB
testcase_46 AC 74 ms
71,436 KB
testcase_47 AC 74 ms
71,432 KB
testcase_48 AC 76 ms
71,496 KB
testcase_49 AC 78 ms
71,444 KB
testcase_50 AC 76 ms
71,512 KB
testcase_51 AC 76 ms
71,500 KB
testcase_52 AC 77 ms
71,396 KB
testcase_53 AC 79 ms
71,624 KB
testcase_54 AC 78 ms
71,744 KB
testcase_55 AC 77 ms
71,668 KB
testcase_56 AC 76 ms
71,504 KB
testcase_57 AC 76 ms
71,736 KB
testcase_58 AC 79 ms
71,664 KB
testcase_59 AC 77 ms
71,384 KB
testcase_60 AC 77 ms
71,624 KB
testcase_61 AC 75 ms
71,612 KB
testcase_62 AC 71 ms
71,396 KB
testcase_63 AC 74 ms
71,660 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 ** (1 / 2) == int(N ** (1 / 2)):
        return True
    return False

def iscubic(N):
    if N ** (1 / 3) == int(N ** (1 / 3)):
        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
            if i == 1:
                continue
            ass.append(N // i)
    
    if N == sum(ass):
        return True

    return False




def main():
    N = int(input())
    
    if N < 2:
        print(N)
        exit()
    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