結果

問題 No.103 素因数ゲーム リターンズ
ユーザー Kiona1018
提出日時 2019-08-26 08:11:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 601 bytes
コンパイル時間 1,469 ms
コンパイル使用メモリ 157,668 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 18:37:50
合計ジャッジ時間 2,347 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;

int main()
{
    int n;
    cin >> n;
    int ans = 0;
    rep(i, 0, n)
    {
        int m;
        cin >> m;

        rep(j, 2, m + 1)
        {
            int cnt = 0;
            while (m % j == 0)
            {
                m /= j;
                ++cnt;
            }
            ans ^= cnt % 3;
        }
    }

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