結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2018-11-17 00:16:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 577 bytes |
| コンパイル時間 | 2,241 ms |
| コンパイル使用メモリ | 200,708 KB |
| 最終ジャッジ日時 | 2025-01-06 16:45:21 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
template<typename T>
map<T, Int> factorize(T x){
map<T, Int> res;
for(Int i=2;i*i<=x;i++){
while(x%i==0){
x/=i;
res[i]++;
}
}
if(x!=1) res[x]++;
return res;
}
//INSERT ABOVE HERE
signed main(){
Int n;
cin>>n;
Int ans=0;
for(auto p:factorize(n)) ans^=p.second;
cout<<(ans?"Alice"s:"Bob"s)<<endl;
return 0;
}
beet