結果

問題 No.2 素因数ゲーム
ユーザー koyumeishi
提出日時 2014-11-17 20:32:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 702 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 79,824 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-02 16:48:14
合計ジャッジ時間 1,949 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

vector< pair<int,int> > divisors(int N){
	vector< pair<int,int> > ret;
	for(int i=2; i*i<=N; i++){
		int tmp = 0;
		while(N%i==0){
			tmp++;
			N/=i;
		}
		if(tmp>0){
			ret.push_back( make_pair(i, tmp) );
		}
	}
	if(N!=1){
		ret.push_back( make_pair(N, 1) );
	}
	return ret;
}

int main(){
	int n;
	cin >> n;
	vector< pair<int,int> > d = divisors(n);
	int ans = 0;
	for(int i=0; i<d.size(); i++){
		ans ^= d[i].second;
	}
	cout << (ans==0?"BoB":"Alice") << endl;
	return 0;
}
0