結果

問題 No.2721 "Don't say N" Game
ユーザー 学ぶマン
提出日時 2025-03-02 11:59:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 82,840 KB
実行使用メモリ 70,520 KB
最終ジャッジ日時 2025-03-02 11:59:39
合計ジャッジ時間 1,627 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

# 約数の列挙
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

for i in range(T):
    N = int(input())
    divs = make_divisors(N)
    if len(divs)%2 == 1:
        print('P')
    else:
        print('K')
    
0