結果
| 問題 | No.2725 Coprime Game 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-08 13:53:51 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 751 bytes |
| 記録 | |
| コンパイル時間 | 1,026 ms |
| コンパイル使用メモリ | 214,660 KB |
| 実行使用メモリ | 9,264 KB |
| 最終ジャッジ日時 | 2026-07-06 03:17:18 |
| 合計ジャッジ時間 | 3,029 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 6 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin>>t;
while(t--){
ll n;
cin>>n;
if(n==2){
cout << "P" << endl;
continue;
}
ll x = n;
for(int i=2;i<=100;i++){
if(x%i==0){
while(x%i==0){
x/=i;
}
}
else{
if(gcd(n,i)==1){
cout << "K" << endl;
}
else{
cout << "P" << endl;
}
break;
}
}
}
}