結果

問題 No.2 素因数ゲーム
ユーザー cocolleague
提出日時 2017-02-02 19:09:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1,019 ms / 5,000 ms
コード長 358 bytes
コンパイル時間 2,263 ms
コンパイル使用メモリ 156,776 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 12:54:44
合計ジャッジ時間 4,459 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
static const int INF = 1e8;

int main(void){
	ll n; cin >> n;
	int ans = 0;
	for(int i = 2; i <= n;++i){
		int cnt =0;
		while(n % i == 0){
			cnt++;
			n /= i;
		}
		ans ^= cnt;
	}
	if(ans == 0) printf("Bob\n");
	else printf("Alice\n");
	return 0;
}
0