結果

問題 No.889 素数!
コンテスト
ユーザー roaris
提出日時 2019-09-20 21:37:01
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 68 ms / 2,000 ms
+ 824µs
コード長 391 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 236 ms
コンパイル使用メモリ 96,232 KB
実行使用メモリ 79,104 KB
最終ジャッジ日時 2026-08-27 07:08:32
合計ジャッジ時間 6,991 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())

if N in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61]:
    print('Sosu!')
elif N in [4, 9, 16, 25, 36, 49]:
    print('Heihosu!')
elif N in [8, 27]:
    print('Ripposu!')
else:
    cnt = 0
    
    for i in range(1, N):
        if N % i == 0:
            cnt += i
    
    if N != 0 and cnt == N:
        print('Kanzensu!')
    else:
        print(N)
0