結果
問題 | No.2721 "Don't say N" Game |
ユーザー |
![]() |
提出日時 | 2025-02-05 16:52:45 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 548 bytes |
コンパイル時間 | 4,710 ms |
コンパイル使用メモリ | 275,164 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-02-05 16:52:53 |
合計ジャッジ時間 | 5,930 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #ifdef LOCAL #include <debug.hpp> #else #define debug(...) #endif int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int T; cin >> T; constexpr int M = 1000; vector<int> cnt(M + 1); for (int i = 1; i <= M; i++) { for (int j = i; j <= M; j += i) { cnt[j]++; } } while (T--) { int N; cin >> N; cout << (cnt[N] & 1 ? 'P' : 'K') << '\n'; } }