結果
| 問題 |
No.103 素因数ゲーム リターンズ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-23 08:01:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 613 bytes |
| コンパイル時間 | 835 ms |
| コンパイル使用メモリ | 59,868 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 23:13:07 |
| 合計ジャッジ時間 | 1,310 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 15 WA * 5 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<int> v;
void calc(int m){
int a=m;
for(int i=2; i<=m; ++i){
if(a==1) break;
if(a%i==0){
int x=0;
while(1){
if(a%i!=0){
v.push_back(x);
x=0;
break;
}
a/=i;
x+=1;
}
}
}
}
int main(){
cin>>n;
int m;
for(int i=0; i<n; ++i){
cin>>m;
calc(m);
}
int x=0;
for(int i=0; i<v.size(); ++i){
int a=v[i]%3;
if(a==1 || a==2) x+=1;
}
if(x%2==1){
cout<<"Alice"<<endl;
} else {
cout<<"Bob"<<endl;
}
return 0;
}