結果

問題 No.2725 Coprime Game 2
ユーザー ゼットゼット
提出日時 2024-04-12 22:43:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 403 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 82,468 KB
実行使用メモリ 76,964 KB
最終ジャッジ日時 2024-04-12 22:43:54
合計ジャッジ時間 3,134 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,920 KB
testcase_01 AC 37 ms
52,320 KB
testcase_02 AC 37 ms
52,532 KB
testcase_03 AC 277 ms
76,608 KB
testcase_04 AC 303 ms
76,204 KB
testcase_05 AC 403 ms
76,732 KB
testcase_06 AC 318 ms
76,808 KB
testcase_07 AC 237 ms
76,964 KB
testcase_08 AC 288 ms
76,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
Q=int(input())
for _ in range(Q):
  N=int(input())
  if N==2:
    print('P')
    continue
  for x in range(2,N+1):
    if N%x!=0:
      z=x
      break
  if gcd(N,x)==1:
    print('K')
  else:
    print('P')
0