結果
| 問題 | 
                            No.2725 Coprime Game 2
                             | 
                    
| コンテスト | |
| ユーザー | 
                             yu_w(ゆ)
                         | 
                    
| 提出日時 | 2024-04-12 22:40:09 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 384 bytes | 
| コンパイル時間 | 291 ms | 
| コンパイル使用メモリ | 81,792 KB | 
| 実行使用メモリ | 77,952 KB | 
| 最終ジャッジ日時 | 2024-10-02 23:34:13 | 
| 合計ジャッジ時間 | 2,908 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 2 WA * 6 | 
ソースコード
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")
        
            
            
            
        
            
yu_w(ゆ)