結果
| 問題 |
No.2721 "Don't say N" Game
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-06-11 01:22:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 115 ms / 2,000 ms |
| コード長 | 628 bytes |
| コンパイル時間 | 426 ms |
| コンパイル使用メモリ | 82,440 KB |
| 実行使用メモリ | 76,928 KB |
| 最終ジャッジ日時 | 2025-06-11 01:22:48 |
| 合計ジャッジ時間 | 2,064 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
from collections import Counter
def factorize(n: int) -> list[int]:
res = []
p = 2
while p * p <= n:
while n % p == 0:
res.append(p)
n //= p
p += 1
if n > 1:
res.append(n)
return res
def number_of_divisors(n: int) -> int:
"""n の約数の個数を求める"""
res = 1
for v in Counter(factorize(n)).values():
res *= v+1
return res
def solve() -> bool:
N = int(input())
x = number_of_divisors(N)
return x % 2 == 0
T = int(input())
for _ in range(T):
if solve():
print('K')
else:
print('P')
norioc