結果

問題 No.2725 Coprime Game 2
ユーザー KudeKude
提出日時 2024-04-12 23:04:16
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 3,578 ms
コンパイル使用メモリ 272,720 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-12 23:04:21
合計ジャッジ時間 4,643 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 26 ms
6,944 KB
testcase_04 AC 32 ms
6,940 KB
testcase_05 AC 26 ms
6,940 KB
testcase_06 AC 21 ms
6,940 KB
testcase_07 AC 17 ms
6,940 KB
testcase_08 AC 24 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int tt;
  cin >> tt;
  constexpr unsigned char pe[] = {2,3,4,5,7,8,9,11,13,16,17,19,23,25,27,29,31,32,37,41,43,47,49,53};
  constexpr bool res[] = {1,1,0,1,1,0,0,1,1,0,1,1,1,0,0,1,1,0,1,1,1,1,0,1};
  while (tt--) {
    unsigned long long n;
    cin >> n;
    if (n == 2) {
      cout << "P\n";
    } else {
      int i = 0;
      while (n % pe[i] == 0) i++;
      cout << "PK"[res[i]] << '\n';
    }
  }
}
0