結果

問題 No.2 素因数ゲーム
ユーザー kyo1
提出日時 2022-06-28 16:19:27
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 351 bytes
コンパイル時間 2,271 ms
コンパイル使用メモリ 193,168 KB
最終ジャッジ日時 2025-01-30 01:20:31
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

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