結果

問題 No.2725 Coprime Game 2
コンテスト
ユーザー MasKoaTS
提出日時 2024-03-29 15:32:07
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 302 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 371 ms
コンパイル使用メモリ 84,736 KB
実行使用メモリ 82,048 KB
最終ジャッジ日時 2026-04-16 17:58:29
合計ジャッジ時間 2,393 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

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

t = int(input())
for _ in [0] * t:
    n = int(input())
    print(solve(n))
0