結果

問題 No.2379 Burnside's Theorem
ユーザー 学ぶマン
提出日時 2025-08-07 21:19:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 82,632 KB
実行使用メモリ 59,448 KB
最終ジャッジ日時 2025-08-07 21:20:00
合計ジャッジ時間 2,334 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factorize(n): # O(√n)
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N = int(input())


if len(set(prime_factorize(N))) <= 2:
    print('Yes')
else:
    print('No')
0