結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
aka_satana_ha
|
| 提出日時 | 2017-12-22 12:08:05 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 490 bytes |
| コンパイル時間 | 344 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 117,632 KB |
| 最終ジャッジ日時 | 2024-12-17 23:08:49 |
| 合計ジャッジ時間 | 95,863 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 WA * 1 TLE * 11 |
ソースコード
import math
N=int(input())
prime_max=int(math.sqrt(N))+1
is_prime=[True for i in range(prime_max)]
#ふるい
for i in range(2,prime_max):
if is_prime[i]==True:
tmp=i+i
while(tmp<prime_max):
is_prime[tmp]=False
tmp+=i
# print(is_prime)
count=0
j=2
while(j<prime_max and count<2):
if is_prime[j]==True:
if N%j==0:
count+=1
N=int(N/j)
continue
j+=1
out='YES' if count>=2 else 'NO'
print(out)
aka_satana_ha