結果
| 問題 | No.889 素数! |
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-07-04 18:49:52 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 691 bytes |
| 記録 | |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-14 10:39:39 |
| 合計ジャッジ時間 | 3,671 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 61 |
ソースコード
def sosu(x):
for i in range(2,x):
if x % i == 0:
return False
return True
def heihosu(x):
for i in range(2,x+1):
if pow(i, 2) == x:
return True
return False
def ripposu(x):
for i in range(2,x+1):
if pow(i, 3) == x:
return True
return False
def kanzensu(x):
s = 0
for i in range(1,x+1):
if x % i == 0:
s += i
if s - x == x:
return True
return False
N = int(input())
if N <= 1:
print(N)
elif sosu(N):
print('Sosu!')
elif heihosu(N):
print('Heihosu!')
elif ripposu(N):
print('Ripposu!')
elif kanzensu(N):
print('Kanzensu!')
else:
print(N)
tnodino