結果

問題 No.2 素因数ゲーム
ユーザー motxxmotxx
提出日時 2014-10-08 18:11:15
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 490 bytes
コンパイル時間 1,377 ms
コンパイル使用メモリ 143,404 KB
実行使用メモリ 5,360 KB
最終ジャッジ日時 2023-08-28 20:35:58
合計ジャッジ時間 2,991 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
ll counter[1100000];
int main() {
  int N; cin >> N;
  for(ll i=2;i*i<=N;i++) {
    while(N % i == 0) {
      counter[i] ++;
      N /= i;
    }
  }
  if(N > 1) {
    counter[N] ++;
  }
  ll nim = 0;
  rep(i, 1100000) {
    nim ^= counter[i];
  }
  if(nim==0) { cout << "Bob\n"; }
  else { cout << "Alice\n"; }
  return 0;
}
0