結果

問題 No.2 素因数ゲーム
ユーザー ちいかわ
提出日時 2025-05-25 02:33:50
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,073 bytes
コンパイル時間 3,157 ms
コンパイル使用メモリ 283,496 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-25 02:33:55
合計ジャッジ時間 4,781 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
random_device seed_gen;
mt19937_64 rnd(seed_gen());
template <typename T> bool chmax(T& A, T B) { if (A < B) { A = B; return true; } return false; }
template <typename T> bool chmin(T& A, T B) { if (A > B) { A = B; return true; } return false; }
#define rep(i, m, n) for (int i = (m); i < (n); i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using ll = long long;
using pint = pair<int, int>;
template<typename T> using min_heap = priority_queue<T, vector<T>, greater<T>>;
#define PI 3.14159265358979323846264338327950288419716939937510
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int n;
    cin >> n;
    map<int, int> mp;
    int t = n;
    for (int i = 2; i * i <= n; i++) {
        while (t % i == 0) {
            t /= i;
            mp[i]++;
        }
    }
    if (t != 1) {
        mp[t]++;
    }
    int xs = 0;
    for (auto [_, x] : mp) {
        xs ^= x;
    }
    cout << (xs ? "Alice" : "Bob") << endl;
    return 0;
}
0