結果

問題 No.2379 Burnside's Theorem
ユーザー shogo314shogo314
提出日時 2023-07-14 21:23:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 84,612 KB
最終ジャッジ日時 2023-10-14 11:19:18
合計ジャッジ時間 4,579 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
83,956 KB
testcase_01 AC 120 ms
84,108 KB
testcase_02 AC 113 ms
84,328 KB
testcase_03 AC 112 ms
84,084 KB
testcase_04 WA -
testcase_05 AC 113 ms
84,404 KB
testcase_06 AC 111 ms
84,288 KB
testcase_07 AC 112 ms
84,312 KB
testcase_08 WA -
testcase_09 AC 112 ms
84,292 KB
testcase_10 WA -
testcase_11 AC 114 ms
84,336 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 124 ms
84,448 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 114 ms
84,084 KB
testcase_20 AC 113 ms
84,328 KB
testcase_21 AC 112 ms
84,208 KB
testcase_22 AC 126 ms
84,284 KB
testcase_23 AC 114 ms
84,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MAX=10**6
prime=[True for i in range(MAX+1)]
prime[0]=prime[1]=False
for i in range(2,MAX+1):
    if not prime[i]:
        continue
    for j in range(2,MAX//i+1):
        prime[i*j]=False
N=int(input())
for i,p in enumerate(prime):
    if p:
        if N%i==0:
            while N%i==0:
                N//=i
            break
for i,p in enumerate(prime):
    if p:
        if N%i==0:
            while N%i==0:
                N//=i
            break
if N==1:
    print('Yes')
else:
    print('No')
0