結果
| 問題 | No.2 素因数ゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-08-25 10:11:44 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 362 bytes | 
| コンパイル時間 | 3,233 ms | 
| コンパイル使用メモリ | 248,604 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-08-25 10:11:50 | 
| 合計ジャッジ時間 | 4,558 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 31 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	vector<pair<int,int>> ans;
	for(int i=2;i*i<=n;i++){
		if(n%i==0){
			int exp=0;
			while(n%i==0){
				exp++;
				n/=i;
			}
			ans.push_back({i,exp});
		}
	}
	if(n!=1)ans.push_back({n,1});
	int x=0;
	for(auto p:ans){
		x^=p.second;
	}
	if(x)cout << "Alice\n";
	else cout << "Bob\n";
}
            
            
            
        