結果
| 問題 | No.2 素因数ゲーム | 
| コンテスト | |
| ユーザー |  SSRS | 
| 提出日時 | 2020-11-07 21:59:27 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 375 bytes | 
| コンパイル時間 | 1,306 ms | 
| コンパイル使用メモリ | 166,056 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-22 14:51:41 | 
| 合計ジャッジ時間 | 2,303 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 31 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int X = 0;
  for (int i = 2; i * i <= N; i++){
    if (N % i == 0){
      int cnt = 0;
      while (N % i == 0){
        cnt++;
        N /= i;
      }
      X ^= cnt;
    }
  }
  if (N > 1){
    X ^= 1;
  }
  if (X > 0){
    cout << "Alice" << endl;
  } else {
    cout << "Bob" << endl;
  }
}
            
            
            
        