結果

問題 No.2 素因数ゲーム
ユーザー 古寺いろは
提出日時 2015-04-09 20:38:50
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 335 bytes
コンパイル時間 1,763 ms
コンパイル使用メモリ 157,280 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 11:05:01
合計ジャッジ時間 2,965 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;


int main(){
	int N;
	cin >> N;
	int ans = 0;
	for (int i = 2; i * i<= N; i++)
	{
		if (N%i == 0){
			int count = 0;
			while (N%i == 0){
				N /= i;
				count++;
			}
			ans ^= count;
		}
	}
	if (N != 1) ans ^= 1;
	if (ans == 0) cout << "Bob" << endl;
	else cout << "Alice" << endl;
}


0