結果
| 問題 |
No.2721 "Don't say N" Game
|
| コンテスト | |
| ユーザー |
prin_kemkem
|
| 提出日時 | 2024-04-12 21:23:00 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 103 ms / 2,000 ms |
| コード長 | 874 bytes |
| コンパイル時間 | 176 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 80,896 KB |
| 最終ジャッジ日時 | 2024-10-02 22:56:26 |
| 合計ジャッジ時間 | 1,321 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
from collections import defaultdict, deque, Counter
from functools import cache
# import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
from heapq import heapify, heappop, heappush
import math
import bisect
from pprint import pprint
from random import randint, shuffle
import sys
# sys.setrecursionlimit(200000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)
#################################################
def factor(x):
retm, retM = [], []
i = 1
while i*i <= x:
if x%i == 0:
retm.append(i)
if x//i != i:
retM.append(x//i)
i += 1
return retm+retM[::-1]
T = int(input())
for _ in range(T):
N = int(input())
print("P" if len(factor(N))%2 == 1 else "K")
prin_kemkem