結果
問題 | No.2 素因数ゲーム |
ユーザー |
![]() |
提出日時 | 2022-06-28 16:17:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 403 bytes |
コンパイル時間 | 1,796 ms |
コンパイル使用メモリ | 200,008 KB |
最終ジャッジ日時 | 2025-01-30 01:20:24 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int64_t N; cin >> N; map<int, int> T; for (int64_t i = 2; i * i <= N; i++) { while (N % i == 0) { N /= i; T[i]++; } } if (N > 1) T[N]++; int g = 0; for (const auto &[k, v] : T) { g ^= v; } cout << (g == 0 ? "Bob" : "Alice") << '\n'; return 0; }