結果
| 問題 |
No.2721 "Don't say N" Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-12 21:23:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 76 ms / 2,000 ms |
| コード長 | 465 bytes |
| コンパイル時間 | 173 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 69,504 KB |
| 最終ジャッジ日時 | 2024-10-02 22:56:32 |
| 合計ジャッジ時間 | 965 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
# 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")