結果
問題 |
No.2 素因数ゲーム
|
ユーザー |
|
提出日時 | 2023-01-06 17:05:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 2,047 bytes |
コンパイル時間 | 5,802 ms |
コンパイル使用メモリ | 390,548 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-30 12:23:38 |
合計ジャッジ時間 | 6,741 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#pragma region KCLC // #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #include <ext/rope> using __gnu_cxx::rope; #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> using Bint = boost::multiprecision::cpp_int; using Real = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1024>>; using ll = long long; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; #define pb push_back #define mp make_pair #define mt make_tuple #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define elif else if #define updiv(N, X) ((N + X - 1) / X) #define sigma(a, b) ((a + b) * (b - a + 1) / 2) #ifdef LOCAL #include "debug.hpp" #else #define debug(...) #endif struct fast_ios { fast_ios() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }; } fast_ios_; template <typename T> inline bool chmax(T& a, T b) { return ((a < b) ? (a = b, true) : (false)); } template <typename T> inline bool chmin(T& a, T b) { return ((a > b) ? (a = b, true) : (false)); } #pragma endregion KCLC //---------------------------------------------------------------------------- constexpr int inf = 1 << 30; constexpr ll INF = 1LL << 60; constexpr int dx[] = {1, 0, -1, 0, 1, -1, 1, -1}; constexpr int dy[] = {0, 1, 0, -1, 1, 1, -1, -1}; constexpr int mod = 998244353; constexpr int MOD = 1e9 + 7; map<long long, int> prime_factorize(long long n) { map<long long, int> res; for (long long p = 2; p * p <= n; ++p) { if (n % p != 0) continue; int num = 0; while (n % p == 0) { ++num; n /= p; } res[p] = num; } if (n != 1) res[n] = 1; return res; } int main() { int N; cin>>N; auto a=prime_factorize(N); int sum=0; for(const auto &i:a){ sum=sum^i.second; } cout<<(sum==0? "Bob":"Alice")<<endl; }