結果

問題 No.2 素因数ゲーム
ユーザー d2verbd2verb
提出日時 2015-05-06 09:17:23
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,201 bytes
コンパイル時間 1,089 ms
コンパイル使用メモリ 91,412 KB
実行使用メモリ 101,452 KB
最終ジャッジ日時 2023-09-19 07:09:26
合計ジャッジ時間 14,159 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 377 ms
101,108 KB
testcase_01 AC 378 ms
101,252 KB
testcase_02 AC 378 ms
101,192 KB
testcase_03 AC 375 ms
101,256 KB
testcase_04 AC 378 ms
101,248 KB
testcase_05 AC 377 ms
101,212 KB
testcase_06 AC 377 ms
101,188 KB
testcase_07 AC 377 ms
101,160 KB
testcase_08 WA -
testcase_09 AC 378 ms
101,312 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 377 ms
101,072 KB
testcase_13 AC 378 ms
101,228 KB
testcase_14 AC 378 ms
101,076 KB
testcase_15 AC 377 ms
101,076 KB
testcase_16 WA -
testcase_17 AC 377 ms
101,164 KB
testcase_18 AC 376 ms
101,120 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 377 ms
101,080 KB
testcase_27 AC 376 ms
101,228 KB
testcase_28 AC 377 ms
101,172 KB
testcase_29 AC 377 ms
101,124 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <limits>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <complex>

using namespace std;

#define INF (INT_MAX/3)
#define PI (2*acos(0.0))
#define EPS (1e-8)

typedef long long ll;
typedef unsigned long long ull;

bool isPrime[100000001];
ll N;
vector<int> prime;
map<int, int> mp;

void init(){
    for(int i = 0; i <= 100000000; i++) isPrime[i] = true;

    isPrime[0] = isPrime[1] = false;
    for(int i = 2; i * i <= 100000000; i++){
        if(!isPrime[i]) continue;
        prime.push_back(i);
        for(int j = i * i; j <= 100000000; j += i){
            isPrime[i] = false;
        }
    }
}

int main(){
    ios_base::sync_with_stdio(0);
    init();
    cin >> N;
    for(auto p : prime){
        while(N % p == 0){
            N /= p;
            mp[p]++;
        }
    }
    int ans = 0;
    for(auto m : mp){
        ans ^= m.second;
    }
    if(ans == 0) cout << "Bob" << endl;
    else cout << "Alice" << endl;
    return 0;
}
0