結果
問題 |
No.2721 "Don't say N" Game
|
ユーザー |
![]() |
提出日時 | 2023-10-05 22:42:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 1,646 ms |
コンパイル使用メモリ | 199,052 KB |
最終ジャッジ日時 | 2025-02-17 04:32:50 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; unordered_set<int> st = {}; for(int i = 1; i < 32; ++i){ st.insert(i * i); } for(int i = 0; i < t; ++i){ int n; cin >> n; char ans = (st.find(n) != st.end()) ? 'P' : 'K'; cout << ans << endl; } return 0; }