結果
問題 | No.2721 "Don't say N" Game |
ユーザー | otoshigo |
提出日時 | 2024-04-12 21:21:18 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 566 bytes |
コンパイル時間 | 2,145 ms |
コンパイル使用メモリ | 194,660 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-04-12 21:21:21 |
合計ジャッジ時間 | 2,949 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,812 KB |
testcase_02 | AC | 2 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,944 KB |
testcase_04 | AC | 2 ms
6,944 KB |
testcase_05 | AC | 2 ms
6,940 KB |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int T; cin>>T; while(T--){ int N; cin>>N; int x=1; while(x*x<N)x++; if(x*x==N)cout<<"P\n"; else cout<<"K\n"; } }