結果
問題 |
No.2725 Coprime Game 2
|
ユーザー |
|
提出日時 | 2025-07-12 15:11:13 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 355 bytes |
コンパイル時間 | 2,064 ms |
コンパイル使用メモリ | 194,360 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-07-12 15:11:17 |
合計ジャッジ時間 | 3,639 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 |
コンパイルメッセージ
main.cpp: In function ‘void solve()’: main.cpp:11:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%lld", &n); | ~~~~~^~~~~~~~~~~~ main.cpp: In function ‘int main()’: main.cpp:22:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d", &cases); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using LL = long long; const int N = 22; const int MOD = 1e9 + 7; LL n; void solve() { scanf("%lld", &n); int m = 2; while(m < n && n % m == 0) ++m; putchar(std::__gcd(LL(m), n) == 1 ? 'K' : 'P'); putchar(10); } int main() { int cases; scanf("%d", &cases); while(cases--) solve(); return 0; }