結果
問題 |
No.889 素数!
|
ユーザー |
|
提出日時 | 2022-05-07 11:00:02 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 397 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 82,328 KB |
実行使用メモリ | 53,956 KB |
最終ジャッジ日時 | 2024-07-06 14:55:57 |
合計ジャッジ時間 | 3,611 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
def solve(n): s = set() for i in range(2,n+1): if n%i: continue if i**2 == n: return "Heihosu!" if i**3 == n: return "Ripposu!" if i == n and len(s) == 0: return "Sosu!" s.add(n//i) s.add(i) if sum(s) == n*2 and n: return "Kanzensu!" return n n = int(input()) print(solve(n))