結果

問題 No.1506 Unbalanced Pocky Game
ユーザー snrnsidysnrnsidy
提出日時 2021-05-23 00:33:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 767 bytes
コンパイル時間 1,766 ms
コンパイル使用メモリ 195,064 KB
最終ジャッジ日時 2025-01-21 17:17:20
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(void) 
{
    cin.tie(0);
    ios::sync_with_stdio(false); 

    long long int val = 0;
    int n, t;
    vector <long long int> v;

    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin >> t;
        if (i < n - 1)
        {
            val ^= t;
        }
        v.push_back(t);
    }

    if (v[n - 1] == 1)
    {
        if ((val ^ v[n - 1]) == 0)
        {
            cout << "Alice" << '\n';
        }
        else
        {
            cout << "Bob" << '\n';
        }
    }
    else
    {
        if ((val ^ 1) > 0 || (val ^ v[n - 1]) == 0)
        {
            cout << "Alice" << '\n';
        }
        else
        {
            cout << "Bob" << '\n';
        }
    }


    return 0;
}
0