結果

問題 No.1506 Unbalanced Pocky Game
ユーザー ぷら
提出日時 2021-05-14 22:18:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 194,904 KB
最終ジャッジ日時 2025-01-21 11:24:34
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 63
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int>A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    for(int i = N-1; i >= 0; i--) {
        if(A[i] != 1) {
            if((N-i)%2) {
                cout << "Alice" << endl;
            }
            else {
                cout << "Bob" << endl;
            }
            return 0;
        }
    }
    cout << ((N%2)?"Alice":"Bob") << endl;
}
0