結果

問題 No.2725 Coprime Game 2
ユーザー rlangevin
提出日時 2024-04-12 23:14:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 76,768 KB
最終ジャッジ日時 2024-10-02 23:45:56
合計ジャッジ時間 1,866 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from math import gcd

T = int(input())
for _ in range(T):
    N = int(input())
    if N == 2:
        print("P")
    elif N == 3:
        print("K")
    else:
        for i in range(3, N + 1):
            if N % i == 0:
                continue
            print("K") if gcd(i, N) == 1 else print("P")
            break
0