結果
| 問題 | No.2 素因数ゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-07-09 15:17:20 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 5,000 ms | 
| コード長 | 1,231 bytes | 
| コンパイル時間 | 1,695 ms | 
| コンパイル使用メモリ | 175,792 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-07 04:43:43 | 
| 合計ジャッジ時間 | 2,781 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 31 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<l_l> vpl;
typedef vector<string> vs;
typedef pair<l_l,ll> lll;
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=1;i<=(n);i++)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=10100100100100100;
const ll dx[4]={1,-1,0,0};
const ll dy[4]={0,0,1,-1};
template<class T> inline bool chmin(T& a,T b){
if(a>b){
a=b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a,T b){
if(a<b){
a=b;
return true;
}
return false;
}
map<ll,ll> sieve(ll n){
    map<ll,ll> res;
    ll _n=n;
    for(ll i=2;i*i<=n;i++){
        while(_n%i==0){
            _n/=i;
            res[i]++;
        }
    }
    if(_n!=1)res[_n]++;
    return res;
}
int main(){
    ll n;cin>>n;
    auto mp=sieve(n);
    vl num;
    for(auto p:mp){
        num.pb(p.se);
    }
    ll sum=0;
    for(auto p:num)sum^=p;
    if(sum==0){
        cout<<"Bob"<<endl;
    }else cout<<"Alice"<<endl;
    return 0;
}
            
            
            
        