結果

問題 No.2379 Burnside's Theorem
ユーザー taro2023
提出日時 2023-07-15 08:38:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-16 16:50:22
合計ジャッジ時間 1,925 ms
ジャッジサーバーID
(参考情報)
judge1 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

a=int(input())
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors
b=prime_factors(a)
if a==1:
    print("Yes")
    exit()
if len(set(b)) ==2 or len(set(b)) ==1:
    print("Yes")
else:
    print("No")
0