結果

問題 No.103 素因数ゲーム リターンズ
ユーザー itezpaceitezpace
提出日時 2016-08-23 08:01:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 638 ms
コンパイル使用メモリ 59,896 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 11:50:30
合計ジャッジ時間 1,549 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 2 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0