結果
| 問題 | No.8023 素数判定するだけ |
| コンテスト | |
| ユーザー |
tachyon777
|
| 提出日時 | 2020-01-02 16:53:07 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 566 bytes |
| 記録 | |
| コンパイル時間 | 461 ms |
| コンパイル使用メモリ | 20,956 KB |
| 実行使用メモリ | 15,616 KB |
| 最終ジャッジ日時 | 2026-05-16 18:36:45 |
| 合計ジャッジ時間 | 5,633 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 |
ソースコード
n = int(input())
"""素因数分解"""
def factrize(n):
b = 2
fct = []
while b*b <= n:
while n % b == 0:
n //= b
#もし素因数を重複させたくないならここを加えてfct.append(b)を消す
"""
if not b in fct:
fct.append(b)
"""
fct.append(b)
b = b+1
if n > 1:
fct.append(n)
return len(fct) == 1 #リストが帰る
if n == 1:
print("NO")
else:
if factrize(n):
print("YES")
else:
print("NO")
tachyon777