結果

問題 No.2725 Coprime Game 2
コンテスト
ユーザー iastm
提出日時 2026-05-11 18:59:15
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 361 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 405 ms
コンパイル使用メモリ 84,736 KB
実行使用メモリ 82,432 KB
最終ジャッジ日時 2026-05-11 18:59:22
合計ジャッジ時間 3,139 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53]

for _ in range(int(input())):
    N = int(input())
    if N == 2:
        print('P')
        continue
    for p in primes:
        if N % p == 0:
            continue
        if all(N % d == 0 for d in range(2, p)):
            print('K')
        else:
            print('P')
        break
0