結果

問題 No.2379 Burnside's Theorem
ユーザー komkompikomkompi
提出日時 2023-07-15 00:24:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 684 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 121,552 KB
最終ジャッジ日時 2023-10-14 14:46:45
合計ジャッジ時間 5,549 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
121,188 KB
testcase_01 AC 151 ms
121,248 KB
testcase_02 AC 152 ms
121,384 KB
testcase_03 AC 153 ms
121,128 KB
testcase_04 WA -
testcase_05 AC 154 ms
120,980 KB
testcase_06 AC 153 ms
121,312 KB
testcase_07 AC 155 ms
121,240 KB
testcase_08 WA -
testcase_09 AC 157 ms
121,160 KB
testcase_10 WA -
testcase_11 AC 153 ms
121,296 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 151 ms
121,184 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 154 ms
121,048 KB
testcase_20 AC 154 ms
121,316 KB
testcase_21 AC 155 ms
121,040 KB
testcase_22 WA -
testcase_23 AC 150 ms
121,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

def sieve_of_eratosthenes(x):
    nums = [i for i in range(x+1)]

    root = int(pow(x,0.5))
    for i in range(2,root + 1):
        if nums[i] != 0:
            for j in range(i, x+1):
                if i*j >= x+1:
                    break
                nums[i*j] = 0

    primes = sorted(list(set(nums)))[2:]
    
    return primes


primes=sieve_of_eratosthenes(10**6+2)

pool_q=set()

for prime in primes:
    temp=prime
    while temp<=10**12:
        pool_q.add(temp)
        temp*=prime

N=int(input())

for p in primes:
    q=N
    while q%p==0:
        q//=p
    
    if q in pool_q:
        print("Yes")
        exit()
    
print("No")
0