結果

問題 No.2813 Cookie
コンテスト
ユーザー risujiroh
提出日時 2024-07-19 22:21:37
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 7 ms / 2,000 ms
+ 946µs
コード長 435 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,300 ms
コンパイル使用メモリ 330,024 KB
実行使用メモリ 9,900 KB
最終ジャッジ日時 2026-10-25 11:13:03
合計ジャッジ時間 6,076 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

using Int = int64_t;

void Solve() {
  Int n;
  std::cin >> n;
  Int g = 0;
  while (n--) {
    Int a;
    std::cin >> a;
    if (a < 4) {
      g ^= (a + 1) / 2;
    } else {
      g ^= 2 * (a / 3 * 2 - (2 - a % 3));
    }
  }
  std::cout << (g ? "Alice\n" : "Bob\n");
}

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

  Int t;
  std::cin >> t;
  while (t--) {
    Solve();
  }
}
0