結果
| 問題 |
No.889 素数!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-07 21:18:53 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 803 bytes |
| コンパイル時間 | 341 ms |
| コンパイル使用メモリ | 81,984 KB |
| 実行使用メモリ | 54,020 KB |
| 最終ジャッジ日時 | 2024-12-30 03:10:39 |
| 合計ジャッジ時間 | 5,091 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 57 WA * 4 |
ソースコード
def ISPRIME(N):
if N < 2:
return False
elif N == 2:
return True
elif N % 2 == 0:
return False
else:
for i in range(3, int(N ** 0.5) + 1):
if N % i == 0:
return False
return True
def ISSQUARE(N):
return float(N ** 0.5).is_integer()
def ISCUBIC(N):
return float(N ** (1 / 3)).is_integer()
def ISPERFECT(N):
divisors = []
for i in range(1, N + 1):
if N % i == 0:
divisors.append(N)
divisors.append(int(N / i))
return sum(list(set(divisors))[0:len(list(set(divisors))) - 1]) == N
N = int(input())
if ISPRIME(N):
print("Sosu!")
elif ISSQUARE(N):
print("Heihosu!")
elif ISCUBIC(N):
print("Ripposu!")
elif ISPERFECT(N):
print("Kanzensu!")
else:
print(N)