結果

問題 No.2725 Coprime Game 2
ユーザー MasKoaTSMasKoaTS
提出日時 2023-09-29 10:34:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 79,352 KB
最終ジャッジ日時 2023-10-06 00:10:21
合計ジャッジ時間 2,460 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,688 KB
testcase_01 AC 71 ms
71,340 KB
testcase_02 AC 71 ms
71,564 KB
testcase_03 AC 131 ms
79,060 KB
testcase_04 AC 174 ms
79,352 KB
testcase_05 AC 172 ms
79,084 KB
testcase_06 AC 151 ms
79,300 KB
testcase_07 AC 142 ms
78,876 KB
testcase_08 AC 163 ms
79,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

query = [int(input()) for _ in [0] * int(input())]

def solve(n):
    for i in range(2, n):
        if(n % i == 0):
            continue
        if(gcd(n, i) != 1):
            break
        return 'K'
    return 'P'

for n in query:
    print(solve(n))
0