結果
| 問題 |
No.2721 "Don't say N" Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-03 19:19:44 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 606 bytes |
| コンパイル時間 | 2,990 ms |
| コンパイル使用メモリ | 245,204 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-03 19:19:49 |
| 合計ジャッジ時間 | 3,382 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#ifdef LOCAL
#include <algo/debug.h>
#else
#define debug(...) void(0)
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T; cin >> T;
const int N = 1000;
vector<int> cnt(N + 1, 0);
for(int i = 1; i <= N; i++) {
for(int j = i; j <= N; j+=i) {
cnt[j]++;
}
}
debug(cnt);
while(T--) {
int n; cin >> n;
if(cnt[n] % 2) {
cout << "P" << endl;
}else {
cout << "K" << endl;
}
}
}