結果

問題 No.2725 Coprime Game 2
ユーザー 👑 rin204rin204
提出日時 2024-04-12 22:54:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 380 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 76,928 KB
最終ジャッジ日時 2024-04-12 22:54:52
合計ジャッジ時間 3,271 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,536 KB
testcase_01 AC 37 ms
52,012 KB
testcase_02 AC 38 ms
52,940 KB
testcase_03 AC 303 ms
76,568 KB
testcase_04 AC 328 ms
76,328 KB
testcase_05 AC 380 ms
76,928 KB
testcase_06 AC 316 ms
76,832 KB
testcase_07 AC 232 ms
76,236 KB
testcase_08 AC 300 ms
76,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd


def solve():
    n = int(input())
    if n == 2:
        return False
    x = 2
    while n % x == 0:
        x += 1
    return gcd(n, x) == 1


for _ in range(int(input())):
    if solve():
        print("K")
    else:
        print("P")
0