You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
520 B
23 lines
520 B
#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;
|
|
} |