結果

問題 No.2 素因数ゲーム
ユーザー hanbei_dayo
提出日時 2019-12-14 02:00:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 72,624 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-28 01:10:42
合計ジャッジ時間 1,736 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
#include<stdio.h>
using namespace std;
#define mod (1000000000+7)
#define N (10007)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;


int main(void){
	ll n;
	cin>>n;
	ll pnum=0;
	ll m=n;
	for(ll i=2;i<=sqrt(m)+1;i++){
		if(n%i!=0)continue;
		while(true){
			if(n%i==0)n/=i;
			else {
				pnum++;
				break;
			}
		}
	}
	if(n>1)pnum++;
	//cout<<pnum<<endl;
	if(pnum%2==0)cout<<"Alice"<<endl;
	else cout<<"Bob"<<endl;
    return 0;
}
0