結果

問題 No.2 素因数ゲーム
ユーザー Manuel1024
提出日時 2021-07-02 02:03:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 294 ms / 5,000 ms
コード長 481 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 69,760 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 14:20:26
合計ジャッジ時間 2,264 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> cnt;
    for(int i = 2; n > 1; i++){
        if(n % i == 0){
            int cnt1 = 0;
            while(n % i == 0){
                cnt1++;
                n /= i;
            }
            cnt.push_back(cnt1);
        }
    }

    int ans = 0;
    for(auto &p: cnt) ans ^= p;
    if(ans == 0) cout << "Bob" << endl;
    else cout << "Alice" << endl;
    return 0;
}
0