結果

問題 No.2725 Coprime Game 2
ユーザー yu_w(ゆ)yu_w(ゆ)
提出日時 2024-04-12 22:36:35
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 376 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 78,320 KB
最終ジャッジ日時 2024-04-12 22:36:39
合計ジャッジ時間 3,214 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,964 KB
testcase_01 RE -
testcase_02 WA -
testcase_03 AC 328 ms
76,220 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

    isLosenum = 2
    for i in range(2,N):
        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