結果

問題 No.2 素因数ゲーム
ユーザー glretoglreto
提出日時 2020-09-19 19:19:06
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,339 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 96,044 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-05 22:52:30
合計ジャッジ時間 2,703 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<string>
#include<iomanip>
#include<set>
#include<queue>
#include<deque>
#include<sstream>
#include<cmath>
#include<bitset>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(int i = n-1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
#define RALL(a) rbegin(a),rend(a)
typedef long long int ll;
typedef long double ld;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
const int inf = 1<<31-1;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main(void) {
    ll n; cin >> n;
    vector<ll> p;
    ll m = n, sum = 0;
    while (n % 2 == 0) {
        n /= 2; sum++;
    }if (sum > 0)p.push_back(sum);
    sum = 0;
    for (int i = 3; i * i <= m; i += 2) {
        while (n % i == 0) {
            n /= i; sum++;
        }if (sum > 0)p.push_back(sum);
        sum = 0;
    }int ans = 0;
    if (n * n > m) p.push_back(1);
    for (int i : p) ans ^= i, cout << i << endl;
    if (ans != 0) cout << "Alice" << endl;
    else cout << "Bob" << endl;
}
0