結果

問題 No.2725 Coprime Game 2
ユーザー yu_w(ゆ)yu_w(ゆ)
提出日時 2024-04-12 22:40:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 77,816 KB
最終ジャッジ日時 2024-04-12 22:40:12
合計ジャッジ時間 3,306 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,960 KB
testcase_01 AC 36 ms
52,744 KB
testcase_02 WA -
testcase_03 AC 336 ms
76,176 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
for _ in range(int(input())):
    N=int(input())
    Ncopy = N

    LoseNum = 2
    for i in range(2,min(N,1000)):
        isLosenum = True
        while N%i == 0:
            isLosenum = False
            N //= i
        if isLosenum:
            LoseNum = i
            break

    if math.gcd(Ncopy,LoseNum) != 1:
        print("P")
    else:
        print("K")
        
0