結果
| 問題 |
No.2 素因数ゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-22 16:54:17 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 2,204 bytes |
| コンパイル時間 | 4,979 ms |
| コンパイル使用メモリ | 310,764 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-22 16:54:24 |
| 合計ジャッジ時間 | 6,227 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
#include<bits/stdc++.h>
#include<unordered_set>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vl = vector<long long>;
using vvl = vector<vl>;
#define INF ((ll)2e18)
#define IINF ((int)1e9)
const double PI = 3.1415926535897932384626433832795028841971;
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)); }
#define yesno(ans) cout<<(ans?"Yes\n":"No\n")
#define all(v) (v).begin(),(v).end()
const int di[] = { 0, 1, 0,-1 };
const int dj[] = { 1, 0,-1, 0 };
//const int di[] = { 0, 1, 1, 1, 0, -1,-1,-1};
//const int dj[] = { 1, 1, 0,-1,-1, -1, 0, 1};
//const int di[]={-1,-1, 0, 0, 1, 1};
//const int dj[]={-1, 0,-1, 1, 0, 1};
const double EPS = 1e-11;
//using mint = modint998244353;
using mint = modint1000000007;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
std::fill((T*)array, (T*)(array + N), val);
}
#define MAX 300
int solve();
/*
#include <random>
std::random_device seed_gen;
std::mt19937 engine(seed_gen());
void generate() {
int n = engine() %100000 ;
//int n = 1000;
cout << n << endl;
rep(i, n) {
cout<<(engine()%212122 * 10282)%1000000000<<endl;
}
}//*/
int main() {
std::cin.tie(0)->sync_with_stdio(0);
//generate();
int T = 1;
while (T--)solve();
return 0;
}
struct S {
ll val, e;
};
int solve() {
ll n; cin >> n;
vector<S>s;
for (ll i = 2; i * i <= n; i++) {
ll k = 0;
while (n % i == 0) {
k++;
n /= i;
}
if(k)
s.push_back({ i,k });
}
if (n > 1)s.push_back({ n,1 });
ll grundy = 0;
for (auto [x, y] : s) {
grundy ^= y;
}
if (grundy) {
cout << "Alice" << endl;
}
else {
cout << "Bob" << endl;
}
return 0;
}
/*
compile
g++ a.cpp -std=c++17 -I .
./a
*/