結果

問題 No.2813 Cookie
コンテスト
ユーザー chro_96
提出日時 2024-07-19 22:35:09
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 516 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 161 ms
コンパイル使用メモリ 38,464 KB
最終ジャッジ日時 2026-02-22 11:56:47
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

int main () {
  int t = 0;
  int n = 0;
  int a = 0;
  
  int res = 0;
  
  res = scanf("%d", &t);
  while (t > 0) {
    int acc = 0;
    int cnt = 0;
    int alt = 0;
    res = scanf("%d", &n);
    while (n > 0) {
      res = scanf("%d", &a);
      if (a > 2) {
        acc ^= a-2;
        cnt++;
      } else {
        alt ^= 1;
      }
      n--;
    }
    if (acc > 0 || (cnt <= 0 && alt > 0)) {
      printf("Alice\n");
    } else {
      printf("Bob\n");
    }
    t--;
  }
  
  return 0;
}
0