結果

問題 No.103 素因数ゲーム リターンズ
ユーザー kyo1kyo1
提出日時 2022-06-30 15:52:40
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 2,036 ms
コンパイル使用メモリ 201,136 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-16 02:25:39
合計ジャッジ時間 3,495 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<int> M(N);
  for (auto&& e : M) {
    cin >> e;
  }
  int res = 0;
  for (const auto& e : M) {
    int m = e;
    for (int i = 2; i * i <= m; i++) {
      int c = 0;
      while (m % i == 0) {
        m /= i;
        c++;
      }
      res ^= c % 2;
    }
    if (m > 1) res ^= 1;
  }
  cout << (res == 0 ? "Bob" : "Alice") << '\n';
  return 0;
}
0