結果

問題 No.2721 "Don't say N" Game
ユーザー MasKoaTSMasKoaTS
提出日時 2023-09-28 18:28:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 399 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 2,081 ms
コンパイル使用メモリ 205,824 KB
実行使用メモリ 45,844 KB
最終ジャッジ日時 2023-10-05 22:29:15
合計ジャッジ時間 5,377 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 382 ms
45,712 KB
testcase_01 AC 381 ms
45,788 KB
testcase_02 AC 388 ms
45,820 KB
testcase_03 AC 391 ms
45,648 KB
testcase_04 AC 398 ms
45,788 KB
testcase_05 AC 399 ms
45,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define inf 1000000000ll
using namespace std;
using ll = long long;


int main(){
    int t;  cin >> t;

    unordered_set<ll> st = {};
    for(ll i = 1; i <= 1000000ll; ++i){
        st.insert(i * i);
    }
    for(int i = 0; i < t; ++i){
        ll n;   cin >> n;
        if(st.find(n) != st.end()){
            cout << 'P' << endl;
        }
        else{
            cout << 'K' << endl;
        }
    }

    return 0;
}
0