結果

問題 No.2379 Burnside's Theorem
ユーザー shogo314shogo314
提出日時 2023-07-14 21:24:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 84,232 KB
最終ジャッジ日時 2023-10-14 11:21:21
合計ジャッジ時間 4,919 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
84,132 KB
testcase_01 AC 119 ms
83,992 KB
testcase_02 AC 113 ms
83,956 KB
testcase_03 AC 115 ms
84,040 KB
testcase_04 AC 120 ms
84,028 KB
testcase_05 AC 120 ms
84,052 KB
testcase_06 AC 115 ms
84,076 KB
testcase_07 AC 112 ms
83,596 KB
testcase_08 WA -
testcase_09 AC 109 ms
84,228 KB
testcase_10 WA -
testcase_11 AC 110 ms
83,972 KB
testcase_12 WA -
testcase_13 AC 121 ms
84,156 KB
testcase_14 AC 120 ms
84,100 KB
testcase_15 AC 117 ms
83,668 KB
testcase_16 AC 121 ms
83,692 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 112 ms
83,972 KB
testcase_20 AC 114 ms
83,664 KB
testcase_21 AC 114 ms
83,968 KB
testcase_22 AC 117 ms
84,232 KB
testcase_23 AC 107 ms
83,652 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
else:
    print('Yes')
    exit(0)
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