結果

問題 No.2721 "Don't say N" Game
ユーザー hirakuuuuhirakuuuu
提出日時 2024-04-12 21:23:00
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 959 bytes
コンパイル時間 3,473 ms
コンパイル使用メモリ 276,152 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-12 21:23:04
合計ジャッジ時間 3,959 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 5 ms
6,940 KB
testcase_02 AC 5 ms
6,940 KB
testcase_03 AC 7 ms
6,940 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 5 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define inr(l, x, r) (l <= x && x < r)
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
// constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
constexpr int IINF = 1001001001;
constexpr ll INF = 9e18;

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

ll power(ll a, ll b, ll m=MOD){
    ll res = 1;
    while(b > 0){
        if(b%2 == 1) res = res*a%m;
        a = a*a%m;
        b /= 2;
    }
    return res;
}

int main(){
    int t; cin >> t;
    while(t--){
        int n; cin >> n;
        vector<int> y;
        rep(i, 1, n+1){
            if(n%i == 0) y.push_back(i);
        }
        if(y.size()%2 == 0) cout << "K" << endl;
        else cout << "P" << endl;
    }
    return 0;
}
0