結果

問題 No.3752 No Use Crying Over Suffixes
コンテスト
ユーザー marc2825
提出日時 2026-08-11 10:18:29
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 15 ms / 2,000 ms
+ 986µs
コード長 756 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,022 ms
コンパイル使用メモリ 211,424 KB
実行使用メモリ 9,912 KB
最終ジャッジ日時 2026-10-02 20:55:00
合計ジャッジ時間 4,054 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

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

    int T;
    cin >> T;

    while (T--) {
        int N;
        cin >> N;

        int state = 0;

        for (int i = 0; i < N; ++i) {
            long long A;
            cin >> A;

            if (state == 0) {
                if (A == 1) {
                    state = 2;
                } else if (A % 2 == 1) {
                    state = 1;
                }
            } else if (state == 1) {
                if (A % 2 == 1) {
                    state = 0;
                }
            } else {
                state = 2;
            }
        }

        cout << (state == 0 ? "Bob" : "Alice") << '\n';
    }

    return 0;
}
0