結果

問題 No.2379 Burnside's Theorem
ユーザー strangerxxxstrangerxxx
提出日時 2023-07-14 21:37:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 1,242 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 77,080 KB
最終ジャッジ日時 2023-10-14 11:40:54
合計ジャッジ時間 3,783 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
72,252 KB
testcase_01 AC 86 ms
71,964 KB
testcase_02 AC 89 ms
71,756 KB
testcase_03 AC 96 ms
76,596 KB
testcase_04 AC 90 ms
76,988 KB
testcase_05 AC 92 ms
76,960 KB
testcase_06 AC 89 ms
76,912 KB
testcase_07 AC 92 ms
76,820 KB
testcase_08 AC 91 ms
76,896 KB
testcase_09 AC 91 ms
76,716 KB
testcase_10 AC 91 ms
76,980 KB
testcase_11 AC 90 ms
76,824 KB
testcase_12 AC 91 ms
76,804 KB
testcase_13 AC 97 ms
76,892 KB
testcase_14 AC 106 ms
76,964 KB
testcase_15 AC 107 ms
76,888 KB
testcase_16 AC 95 ms
76,940 KB
testcase_17 AC 97 ms
77,080 KB
testcase_18 AC 109 ms
76,708 KB
testcase_19 AC 101 ms
76,996 KB
testcase_20 AC 106 ms
76,916 KB
testcase_21 AC 109 ms
76,928 KB
testcase_22 AC 92 ms
71,448 KB
testcase_23 AC 105 ms
76,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def resolve():
    import sys

    input = sys.stdin.readline
    n = int(input())
    print("Yes" if len(prime_factorization(n)) <= 2 else "No")


def prime_factorization(n: int) -> dict:
    from collections import defaultdict

    pf = defaultdict(int)
    for i in range(2, int(n**0.5) + 1):
        while n % i == 0:
            pf[i] += 1
            n //= i
    if n > 1:
        pf[n] = 1
    return pf


if __name__ == "__main__":
    resolve()
0