結果

問題 No.2 素因数ゲーム
ユーザー neckrawarmerneckrawarmer
提出日時 2021-10-06 14:10:54
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 998 ms / 5,000 ms
コード長 961 bytes
コンパイル時間 5,012 ms
コンパイル使用メモリ 265,356 KB
実行使用メモリ 426,600 KB
最終ジャッジ日時 2023-09-30 08:46:33
合計ジャッジ時間 19,423 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 111 ms
56,020 KB
testcase_07 AC 128 ms
62,824 KB
testcase_08 AC 113 ms
57,640 KB
testcase_09 AC 998 ms
426,600 KB
testcase_10 AC 809 ms
368,272 KB
testcase_11 AC 362 ms
176,376 KB
testcase_12 AC 360 ms
175,988 KB
testcase_13 AC 759 ms
352,932 KB
testcase_14 AC 63 ms
33,668 KB
testcase_15 AC 212 ms
103,276 KB
testcase_16 AC 527 ms
246,296 KB
testcase_17 AC 825 ms
375,660 KB
testcase_18 AC 915 ms
401,772 KB
testcase_19 AC 498 ms
230,720 KB
testcase_20 AC 674 ms
316,016 KB
testcase_21 AC 950 ms
415,544 KB
testcase_22 AC 849 ms
384,668 KB
testcase_23 AC 377 ms
182,516 KB
testcase_24 AC 916 ms
402,336 KB
testcase_25 AC 632 ms
291,004 KB
testcase_26 AC 443 ms
210,356 KB
testcase_27 AC 234 ms
112,632 KB
testcase_28 AC 508 ms
236,872 KB
testcase_29 AC 417 ms
198,748 KB
testcase_30 AC 385 ms
185,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
#endif
using ll = long long;
using ld = long double;
const ll INF = 1ll<<60;
const ld EPS = 1.0/1e9;
#define endl "\n"
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#define del(x) sort(all(x)); x.erase(unique(all(x)),x.end());

int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll n; cin >> n;
  vector<int>lp(n+1);
  vector<int>pr;
  for(int i=2;i<=n;i++){
    if(lp[i]==0){
      lp[i]=i;
      pr.push_back(i);
    }
    for(int j=0;j<(int)pr.size() && pr[j]<=lp[i] && i*pr[j]<=n;j++){
      lp[i*pr[j]]=pr[j];
    }
  }
  map<int,int>mp;
  while(n!=1){
    mp[lp[n]]++; n/=lp[n];
  }
  ll XOR=0;
  fore(c,mp){
    XOR^=c.second;
  }
  if(XOR) cout << "Alice";
  else cout << "Bob";
}
0