結果

問題 No.2 素因数ゲーム
ユーザー yuu_w
提出日時 2024-01-18 18:11:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 659 bytes
コンパイル時間 5,208 ms
コンパイル使用メモリ 250,196 KB
最終ジャッジ日時 2025-02-18 20:26:06
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;

#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

///////////////////////////////////////

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N; cin >> N;
	vector<int> pcnt;
	for(int i = 2; i*i <= N; i++)if(N%i == 0)
	{
		int cnt = 0;
		while(N%i == 0)N /= i, cnt++;
		pcnt.pb(cnt);
	}
	if(N != 1)pcnt.pb(1);
	int xor_sum = 0;
	for(int n : pcnt) xor_sum ^= n;
	cout << (xor_sum ? "Alice" : "Bob") << endl;
}
0