結果

問題 No.2379 Burnside's Theorem
ユーザー yas_yasyu
提出日時 2023-07-14 23:06:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-16 08:15:00
合計ジャッジ時間 2,162 ms
ジャッジサーバーID
(参考情報)
judge6 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def prime_factorize(n):
    a = defaultdict(int)
    while n % 2 == 0:
        a[2] += 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a[f] += 1
            n //= f
        else:
            f += 2
    if n != 1:
        a[n] += 1
    return a


pf = prime_factorize(int(input()))
print("Yes" if (len(pf) == 2 and len(set(pf.values())) == 2) or len(pf) == 1 else "No")
0