結果
| 問題 |
No.2 素因数ゲーム
|
| コンテスト | |
| ユーザー |
stqn
|
| 提出日時 | 2014-11-25 19:26:38 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 588 bytes |
| コンパイル時間 | 2,101 ms |
| コンパイル使用メモリ | 157,280 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 10:48:37 |
| 合計ジャッジ時間 | 3,020 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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