結果

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 710
#endif

vector<int> frac(int x){
	vector<int> ret;
	for(int i = 2; i * i <= x; i++){
		if(x % i == 0){
			int cnt = 0;
			while(x % i == 0){
				cnt++;
				x /= i;
			}
			ret.push_back(cnt);
		}
	}
	if(x != 1) ret.push_back(1);
	return ret;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	auto v = frac(n);
	int nim = 0;
	for(int t: v) nim ^= t;
	cout << (nim ? "Alice" : "Bob") << endl;
}
0