結果

問題 No.2725 Coprime Game 2
ユーザー rlangevinrlangevin
提出日時 2024-04-12 23:14:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 82,288 KB
実行使用メモリ 76,904 KB
最終ジャッジ日時 2024-04-12 23:14:17
合計ジャッジ時間 2,289 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,532 KB
testcase_01 AC 36 ms
52,128 KB
testcase_02 AC 37 ms
53,352 KB
testcase_03 AC 92 ms
76,168 KB
testcase_04 AC 146 ms
76,764 KB
testcase_05 AC 151 ms
76,904 KB
testcase_06 AC 127 ms
76,628 KB
testcase_07 AC 128 ms
76,712 KB
testcase_08 AC 146 ms
76,760 KB
権限があれば一括ダウンロードができます

ソースコード

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