結果
| 問題 |
No.2725 Coprime Game 2
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2024-04-12 22:18:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,232 bytes |
| コンパイル時間 | 4,325 ms |
| コンパイル使用メモリ | 256,168 KB |
| 最終ジャッジ日時 | 2025-02-21 00:28:17 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 WA * 1 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000001
map<long long,long long> mp;
int get(long long n,long long c){
if(mp.count(c))return mp[c];
for(long long i=2;i<c;i++){
if(gcd(c,i)!=1)continue;
if(n%i==0)continue;
if(get(n,i)==0){
mp[c] = 1;
return 1;
}
}
mp[c] = 0;
return 0;
}
int main(){
/*
for(long long i=2;i<=100000;i++){
mp.clear();
if(get(i,i)==0){
if(i%12!=6 && i%420!=0)cout<<'a'<<i<<endl;
}
else{
if(i%12==6 || i%420==0)cout<<'b'<<i<<endl;
}
//if(get(i,i)==0)cout<<i<<endl;
}
*/
/*
for(long long i=720720;true;i+=720720){
mp.clear();
if(get(i,i)==0){
cout<<i<<endl;
}
}
*/
long long t = 2 * 2 * 3 * 5 * 7 * 11 * 13;
//cout<<t<<endl;
t *= 17*19*23*29;
/*
cout<<t<<endl;
cout<<get(t+t/2,t+t/2)<<endl;
t *= 60060;
mp.clear();
cout<<get(t+t/2,t+t/2)<<endl;
*/
int _t;
cin>>_t;
rep(_,_t){
long long n;
cin>>n;
if(n==2 || n%12==6 || (n%420==0 && n%2520!=0) || n%720720==360360 || n%t==(t/2))cout<<"P"<<endl;
else cout<<"K"<<endl;
}
return 0;
}
沙耶花