結果

問題 No.2813 Cookie
ユーザー eve__fuyuki
提出日時 2024-07-19 23:03:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,235 bytes
コンパイル時間 1,913 ms
コンパイル使用メモリ 193,956 KB
最終ジャッジ日時 2025-02-23 16:50:34
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void fast_io() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
}

int main() {
	fast_io();
	// vector<int> dp(30, 0);
	// for (int i = 1; i < 30; i++) {
	// 	set<int> st{0};
	// 	vector<vector<int>> sep;
	// 	sep.push_back({i});
	// 	while (sep.back().front() != 1) {
	// 		sep.push_back(sep.back());
	// 		int i = sep.back().size() - 1;
	// 		int one_cnt = 0;
	// 		while (sep.back()[i] == 1) {
	// 			i--;
	// 			one_cnt++;
	// 			sep.back().pop_back();
	// 		}
	// 		int l = sep.back().back();
	// 		sep.back().pop_back();
	// 		sep.back().push_back(l - 1);
	// 		for (int j = 0; j < one_cnt + 1; j++) {
	// 			sep.back().push_back(1);
	// 		}
	// 		sort(sep.back().rbegin(), sep.back().rend());
	// 	}
	// 	for (auto e : sep) {
	// 		int g = 0;
	// 		for (int i = 0; i < e.size(); i++) {
	// 			g ^= dp[e[i]];
	// 		}
	// 		st.insert(g);
	// 	}
	// 	while (st.count(dp[i])) {
	// 		dp[i]++;
	// 	}
	// 	cout << i << " " << dp[i] << "\n";
	// }
	int t;
	cin >> t;
	for (; t--;) {
		int n;
		cin >> n;
		vector<int> a(n);
		int g = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
			int d = (a[i] - 1) / 2 * 2;
			g ^= max(1, d);
		}
		cout << (g ? "Alice\n" : "Bob\n");
	}
}
0