結果

問題 No.2 素因数ゲーム
ユーザー szx233
提出日時 2023-04-08 17:40:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 507 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 63,740 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-03 13:52:34
合計ジャッジ時間 1,536 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
typedef long long ll;

int main()
{
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int u = 0;
    for(int i = 2; i <= n / i; i ++ )
        if(n % i == 0)
        {
            int s = 0;
            while(n % i == 0) n /= i, s ++ ;
            if(!u) u = s;
            else u ^= s;
        }
    if(n > 1)
    {
        if(!u) u = 1;
        else u ^= 1;
    }

    if(u) puts("Alice");
    else puts("Bob");

    return 0;
}
0