結果
| 問題 | No.2725 Coprime Game 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-05 20:32:22 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 81 ms / 2,000 ms |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 3,054 ms |
| コンパイル使用メモリ | 273,620 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-04 16:32:16 |
| 合計ジャッジ時間 | 4,364 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
ll N;
void solve(){
if(N==2){
cout<<"P"<<endl;
return;
}
ll x;
for(ll i = 2;;i++){
if(N%i){
x = i;
break;
}
}
if(gcd(N,x)!=1){
cout<<"P"<<endl;
}else{
cout<<"K"<<endl;
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while (T--) {
cin >> N;
solve();
}
}