結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
stqn
|
| 提出日時 | 2014-11-25 19:26:38 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 588 bytes |
| 記録 | |
| コンパイル時間 | 916 ms |
| コンパイル使用メモリ | 174,864 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-01 08:22:47 |
| 合計ジャッジ時間 | 2,251 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define long int64_t
#define ulong uint64_t
int n;
void input()
{
cin >> n;
}
bool solve()
{
int parity = 0;
for (int i = 2; i * i <= n; ++i) {
int tmp = 0;
while (n % i == 0) n /= i, ++tmp;
parity ^= tmp;
}
parity ^= n > 2;
return parity;
}
int main()
{
cin.tie(0);
ios_base::sync_with_stdio(false);
input();
cout << (solve() ? "Alice" : "Bob") << endl;
}
stqn