結果

問題 No.2379 Burnside's Theorem
ユーザー minimumminimum
提出日時 2023-07-14 21:22:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 567 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 87,628 KB
最終ジャッジ日時 2023-10-14 11:17:21
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
87,384 KB
testcase_01 AC 118 ms
87,060 KB
testcase_02 AC 117 ms
87,348 KB
testcase_03 AC 121 ms
87,320 KB
testcase_04 AC 119 ms
87,360 KB
testcase_05 AC 116 ms
87,308 KB
testcase_06 AC 120 ms
87,552 KB
testcase_07 AC 118 ms
87,496 KB
testcase_08 AC 118 ms
87,332 KB
testcase_09 AC 120 ms
87,388 KB
testcase_10 AC 120 ms
87,496 KB
testcase_11 AC 121 ms
87,064 KB
testcase_12 AC 117 ms
87,332 KB
testcase_13 AC 117 ms
87,220 KB
testcase_14 AC 118 ms
87,064 KB
testcase_15 AC 117 ms
87,628 KB
testcase_16 AC 119 ms
87,344 KB
testcase_17 AC 121 ms
87,320 KB
testcase_18 AC 123 ms
87,176 KB
testcase_19 AC 120 ms
87,368 KB
testcase_20 AC 119 ms
87,332 KB
testcase_21 AC 118 ms
87,444 KB
testcase_22 AC 119 ms
87,060 KB
testcase_23 AC 121 ms
87,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def primelist(N):
    pr = []
    lpf = [0] * (N + 1)
    for d in range(2, N + 1):
        if lpf[d] == 0:
            lpf[d] = d
            pr.append(d)
        for p in pr:
            if p * d > N or p > lpf[d]:
                break
            lpf[p * d] = p
    return pr

N = int(input())
pr = primelist(10 ** 6)
cnt = 0
for p in pr:
    if N % p != 0:
        continue
    cnt += 1
    while N % p == 0:
        N //= p

if N != 1:
    cnt += 1

if cnt <= 2:
    print("Yes")
else:
    print("No")

0