結果

問題 No.36 素数が嫌い!
ユーザー titiatitia
提出日時 2021-11-28 02:30:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,361 ms / 5,000 ms
コード長 350 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 8,280 KB
最終ジャッジ日時 2023-09-13 07:21:10
合計ジャッジ時間 17,524 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 629 ms
8,244 KB
testcase_01 AC 919 ms
8,088 KB
testcase_02 AC 16 ms
8,036 KB
testcase_03 AC 15 ms
8,096 KB
testcase_04 AC 16 ms
8,096 KB
testcase_05 AC 20 ms
8,132 KB
testcase_06 AC 19 ms
8,124 KB
testcase_07 AC 20 ms
8,176 KB
testcase_08 AC 16 ms
8,124 KB
testcase_09 AC 18 ms
8,076 KB
testcase_10 AC 18 ms
8,100 KB
testcase_11 AC 446 ms
8,124 KB
testcase_12 AC 1,361 ms
8,120 KB
testcase_13 AC 1,342 ms
8,116 KB
testcase_14 AC 666 ms
8,176 KB
testcase_15 AC 16 ms
8,228 KB
testcase_16 AC 16 ms
8,280 KB
testcase_17 AC 16 ms
8,232 KB
testcase_18 AC 16 ms
8,232 KB
testcase_19 AC 540 ms
8,092 KB
testcase_20 AC 1,163 ms
8,276 KB
testcase_21 AC 1,024 ms
8,172 KB
testcase_22 AC 1,055 ms
8,084 KB
testcase_23 AC 640 ms
8,240 KB
testcase_24 AC 604 ms
8,124 KB
testcase_25 AC 703 ms
8,248 KB
testcase_26 AC 831 ms
8,180 KB
testcase_27 AC 1,148 ms
8,228 KB
testcase_28 AC 800 ms
8,180 KB
testcase_29 AC 1,302 ms
8,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x=int(input())

# 素因数分解
import math 
L=int(math.sqrt(x))

FACT=dict()

for i in range(2,L+2):
    while x%i==0:
        FACT[i]=FACT.get(i,0)+1
        x=x//i

if x!=1:
    FACT[x]=FACT.get(x,0)+1

if len(FACT)>=3 or (len(FACT)==2 and max(FACT.values())>=2) or len(FACT)==1 and max(FACT.values())>=3:
    print("YES")
else:
    print("NO")
0