Files
python/TangDou/AcWing_TiGao/T5/GameTheory/HDU1850.cpp

23 lines
520 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10;
int n, a[N], res;
int main() {
while (scanf("%d", &n) && n) {
res = 0;
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
res ^= a[i];
}
if (res == 0)
puts("0");
else {
int ans = 0;
for (int i = 1; i <= n; i++)
if ((res ^ a[i]) < a[i]) ans++;
printf("%d\n", ans);
}
}
return 0;
}