結果

問題 No.2379 Burnside's Theorem
ユーザー yas_yasyuyas_yasyu
提出日時 2023-07-14 23:10:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 8,656 KB
最終ジャッジ日時 2023-10-14 13:37:25
合計ジャッジ時間 1,711 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,520 KB
testcase_01 AC 17 ms
8,656 KB
testcase_02 AC 15 ms
8,476 KB
testcase_03 AC 16 ms
8,440 KB
testcase_04 AC 16 ms
8,584 KB
testcase_05 AC 16 ms
8,544 KB
testcase_06 AC 17 ms
8,504 KB
testcase_07 AC 16 ms
8,612 KB
testcase_08 AC 16 ms
8,556 KB
testcase_09 AC 16 ms
8,600 KB
testcase_10 AC 16 ms
8,612 KB
testcase_11 AC 18 ms
8,536 KB
testcase_12 AC 17 ms
8,508 KB
testcase_13 AC 53 ms
8,556 KB
testcase_14 AC 63 ms
8,532 KB
testcase_15 AC 82 ms
8,472 KB
testcase_16 AC 23 ms
8,520 KB
testcase_17 AC 18 ms
8,560 KB
testcase_18 AC 22 ms
8,552 KB
testcase_19 AC 15 ms
8,548 KB
testcase_20 AC 15 ms
8,548 KB
testcase_21 AC 17 ms
8,456 KB
testcase_22 AC 16 ms
8,612 KB
testcase_23 AC 17 ms
8,612 KB
権限があれば一括ダウンロードができます

ソースコード

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


print("Yes" if len(prime_factorize(int(input()))) <= 2 else "No")
0