結果
| 問題 |
No.2721 "Don't say N" Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-15 09:01:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,424 bytes |
| コンパイル時間 | 2,442 ms |
| コンパイル使用メモリ | 178,728 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-05 01:49:51 |
| 合計ジャッジ時間 | 2,030 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 3 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, p, n) for (ll i = p; i < (ll)(n); i++)
#define rep2(i, p, n) for(ll i = p; i >= (ll)(n); i-- )
using namespace std;
using ll = long long;
using ld = long double;
double pi=3.141592653589793;
const long long inf=2*1e9;
const long long linf=4*1e18;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//atcoder
#include <atcoder/modint>
#include <atcoder/dsu>
#include <atcoder/segtree>
#include <atcoder/lazysegtree>
using namespace atcoder;
using mint1 = modint1000000007;
using mint2 = modint998244353;
/*
//多倍長整数
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using ci = cpp_int;
//ciで定義
//https://boostjp.github.io/tips/multiprec-int.html
//常時使っているとdouble >> llの適切なキャストができない(ll sqrt(整数)等)ので、基本はコメントアウト
*/
//拡張ユークリッド
//input: ll a,b
//output: ax+by=gcd(a,b)の解(x,y)(<max(a, b))
pair<long long, long long> extgcd(long long a, long long b) {
if (b == 0) return make_pair(1, 0);
long long x, y;
tie(y, x) = extgcd(b, a % b);
y -= a / b * x;
return make_pair(x, y);
}
//素数列挙
//output: (void)N以下の整数のうち素数であるものをsosuuに返す
void SR(ll N, vector<ll> &sosuu) {
vector<bool> testSR(N+1, true);
for(int i=2; i<=N; i++) {
if (testSR.at(i)) {
sosuu.push_back(i);
for(int j=i*2; j<=N; j+=i) {
testSR.at(j)=false;
}
}
}
}
int main() {
////////////////////
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
////////////////////
ll N;
cin >> N;
vector<ll> base={2,3,5,7,11,13,17,19,23,29,31};
while(N--) {
ll P;
bool ch=true;
cin >> P;
rep(i, 0, 11) {
ll R=0;
while(true) {
if (P%base.at(i)==0) {
R++;
P/=base.at(i);
}
else {
break;
}
}
if (R%2==1) {
ch=false;
}
}
if (ch) {
cout << "P";
}
else{
cout << "K";
}
cout << endl;
}
}