結果
| 問題 |
No.103 素因数ゲーム リターンズ
|
| コンテスト | |
| ユーザー |
e6i24v_kyopro
|
| 提出日時 | 2021-05-07 00:52:25 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 1,112 bytes |
| コンパイル時間 | 1,816 ms |
| コンパイル使用メモリ | 174,276 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 15:33:38 |
| 合計ジャッジ時間 | 3,164 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> dp(10050);
void init(){
dp[0]=0;dp[1]=1;
for(int i=2;i<10050;i++){
vector<int> v(10);
for(int k=1;k<=2;k++){
v[dp[i-k]]=1;
}
for(int j=0;j<=10;j++){
if(v[j]==0){
dp[i]=j;
break;
}
}
}
}
int main(){
int N;
cin>>N;
int M;
int flag=0;
init();
for(int i=0;i<N;i++){
cin>>M;
map<int,int> mp;
for(int j=2;j<=M;j++){
if(M%j!=0)continue;
while(M%j==0){
M/=j;
mp[j]++;
}
}
if(M!=1){mp[M]++;}
//cout<<"----"<<endl;
for(auto a:mp){
//cout<<a.first<<" "<<a.second<<endl;
flag^=dp[a.second];
}
}
flag^=0;
if(flag){
cout<<"Alice"<<endl;
}else{
cout<<"Bob"<<endl;
}
/*
for(int i=0;i<100;i++){
cout<<dp[i]<<" ";
}
cout<<endl;
*/
}
e6i24v_kyopro