結果

問題 No.2721 "Don't say N" Game
ユーザー NP
提出日時 2024-04-12 21:27:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 66,176 KB
最終ジャッジ日時 2024-10-02 22:59:03
合計ジャッジ時間 971 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    T = int(input().strip())
    for _ in range(T):
        N = int(input().strip())
        divisors = 0
        i = 1
        while i * i <= N:
            if N % i == 0:
                if N / i == i:
                    divisors += 1
                else:
                    divisors += 2
            i += 1
        if divisors % 2 == 0:
            print("K")
        else:
            print("P")

solve()
0