結果

問題 No.2721 "Don't say N" Game
ユーザー Yakumo221Yakumo221
提出日時 2024-04-12 21:23:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,760 KB
実行使用メモリ 70,672 KB
最終ジャッジ日時 2024-04-12 21:23:13
合計ジャッジ時間 1,234 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,524 KB
testcase_01 AC 71 ms
69,616 KB
testcase_02 AC 69 ms
70,672 KB
testcase_03 AC 68 ms
69,384 KB
testcase_04 AC 59 ms
64,100 KB
testcase_05 AC 91 ms
70,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# from math import isqrt

def yakusu_rekkyo(n):
    low = []
    up = []
    for i in range(1, int(pow(n, 1/2))+1):
        if n % i == 0:
            low.append(i)
            if n//i != i:
                up.append(n//i)
    return low + up[::-1]

t = int(input())
while t:
    t -= 1
    n = int(input())
    yakusu = yakusu_rekkyo(n)

    le = len(yakusu)
    if le == 1:
        print("P")
    elif le % 2 == 0:
        print("K")
    else:
        print("P")
0