結果

問題 No.2721 "Don't say N" Game
ユーザー prin_kemkemprin_kemkem
提出日時 2024-04-12 21:23:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 874 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 81,180 KB
最終ジャッジ日時 2024-04-12 21:23:06
合計ジャッジ時間 1,565 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
80,820 KB
testcase_01 AC 113 ms
81,180 KB
testcase_02 AC 103 ms
81,108 KB
testcase_03 AC 103 ms
80,932 KB
testcase_04 AC 102 ms
80,964 KB
testcase_05 AC 101 ms
80,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0