結果
| 問題 |
No.2725 Coprime Game 2
|
| コンテスト | |
| ユーザー |
nonon
|
| 提出日時 | 2024-04-12 22:05:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 36 ms / 2,000 ms |
| コード長 | 352 bytes |
| コンパイル時間 | 1,733 ms |
| コンパイル使用メモリ | 192,200 KB |
| 最終ジャッジ日時 | 2025-02-21 00:23:00 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
template<typename T>
T gcd(T a, T b){return b==0?a:gcd(b,a%b);}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin>>T;
while(T--)
{
long N;
cin>>N;
long k=2;
while(N%k==0)k++;
cout<<(k>=N||gcd(N,k)>1?'P':'K')<<'\n';
}
}
nonon