結果

問題 No.2379 Burnside's Theorem
ユーザー yas_yasyuyas_yasyu
提出日時 2023-07-14 23:06:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 10,472 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2023-10-14 13:32:01
合計ジャッジ時間 2,147 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,492 KB
testcase_01 AC 19 ms
8,428 KB
testcase_02 AC 18 ms
8,440 KB
testcase_03 AC 19 ms
8,468 KB
testcase_04 AC 20 ms
8,432 KB
testcase_05 AC 19 ms
8,520 KB
testcase_06 AC 19 ms
8,564 KB
testcase_07 AC 19 ms
8,456 KB
testcase_08 WA -
testcase_09 AC 19 ms
8,528 KB
testcase_10 WA -
testcase_11 AC 19 ms
8,432 KB
testcase_12 WA -
testcase_13 AC 57 ms
8,436 KB
testcase_14 AC 73 ms
8,512 KB
testcase_15 AC 85 ms
8,524 KB
testcase_16 AC 26 ms
8,576 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 19 ms
8,524 KB
testcase_20 AC 19 ms
8,568 KB
testcase_21 AC 18 ms
8,532 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

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