結果

問題 No.2 素因数ゲーム
ユーザー shin3110shin3110
提出日時 2023-10-27 13:07:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,321 bytes
コンパイル時間 3,932 ms
コンパイル使用メモリ 230,260 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-27 13:07:51
合計ジャッジ時間 5,134 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

/*

              ∧∧∩ 
             ( ゚∀゚)/ キタ━━━━━━(゚∀゚)━━━━━━!!!!  
            ⊂   ノ  ゆっくり見てってね!!!!!!!!
             (つ ノ
    o          (ノ
     \      ☆
             |      o
          (⌒ ⌒ヽ   /     ☆
    \  (´⌒  ⌒  ⌒ヾ   /
      ('⌒ ; ⌒   ::⌒  )
     (´     )     ::: ) /
  ☆─ (´⌒;:    ::⌒`) :;  )

*/
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;


#define elif else if
#define rep(i, s, n) for (int i=s; i<n; i++)
#define all(a) a.begin(), a.end()
// xを2進数にした際にi桁目が0か1か
#define bit(x,i)((x>>i)&1)
typedef long long ll;
typedef long double ld;

ld pi = 3.14159265358979;

inline void scan(){}
template<class Head,class... Tail>
inline void scan(Head&head,Tail&... tail){std::cin>>head;scan(tail...);}
 
// print(a, b, c) => cout << a << ' ' << b << ' ' << c << endl;
inline void print(){}
template<class Head,class... Tail>
inline void print(Head&head,Tail&... tail){std::cout<<head<<" ";print(tail...);cout<<endl;}

// bool型に対して"Yes", "No" を出力する
bool printb(bool f) {if (f) cout << "Yes\n";else cout << "No\n";return f;}

//vectorのcout,cin
template<typename T>
std::istream &operator>>(std::istream&is,std::vector<T>&v){for(T &in:v){is>>in;}return is;}
template<typename T>
std::ostream &operator<<(std::ostream&os,const std::vector<T>&v){for(auto it=std::begin(v);it!=std::end(v);){os<<*it<<((++it)!=std::end(v)?" ":"");}return os;}

// 2地点の距離(long double)
long double coor_dist(long double xi, long double yi, long double xj, long double yj) {
    return sqrt(abs((xi - xj) * (xi - xj)) + abs((yi - yj) * (yi - yj)));
}

// 回文かどうかの判定 
bool iskaibun(string s){ll k = s.size();rep(i,0,k/2){if(s[i]!=s[k-1-i]){return false;}}return true;}

template<class T> void chmax(T& a, T b) { if (a < b) a = b; }
template<class T> void chmin(T& a, T b) { if (a > b) a = b; }



#define mod 998244353
using mint = modint998244353;
int op(int a, int b) {return max(a, b);}
int e() {return 0;}
int mapping(int f, int x) {return (f == 1e9 ? x : f);}
int composition(int f, int g) {return (f == 1e9 ? g : f);}
int id() {return 1e9;}


signed main() {
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> mon;
    for(int i=2; i*i<=n; i++) {
        if(n%i != 0) continue;
        int cnt = 0;
        while(n%i == 0) {
            n /= i;
            cnt++;
        }
        mon.push_back(cnt);
    }

    vector<int> g(mon.size(), 0);
    rep(i, 0, mon.size()) {
        vector<int> mex(50, 0);
        rep(j, 0, i) mex[g[j]] = 1;
        rep(j, 0, 50) if(mex[j] == 0) {
            g[i] = j;
            break;
        }
    }

    int ans = 0;
    rep(i, 0, mon.size()) ans ^= g[mon[i]];

    if(ans) cout << "Bob" << endl;
    else cout << "Alice" << endl;
}
0