check[30], c, n, a, xor_sum, ans;
int main() {
while (1) {
c = getchar_unlocked();
if (48 <= c && c <= 57)
n = n * 10 + c - 48;
else
break;
}
for (int i = 0; i < n; i++) {
a = 0;
while (1) {
c = getchar_unlocked();
if (48 <= c && c <= 57)
a = a * 10 + c - 48;
else
break;
}
xor_sum ^= a;
a = a ^ (a - 1);
check[__builtin_popcount(a) - 1] = 1;
}
for (int bit = 29; bit >= 0; bit--) {
if (check[bit] && ((1 << bit) & xor_sum)) {
int x = (1 << (bit + 1)) - 1;
xor_sum ^= x;
ans += 1;
}
}
printf("%d\n", xor_sum ? -1 : ans);
}
./Main.c:1:1: warning: data definition has no type or storage class
check[30], c, n, a, xor_sum, ans;
^
./Main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘check’ [-Wimplicit-int]
./Main.c:1:12: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int]
check[30], c, n, a, xor_sum, ans;
^
./Main.c:1:15: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
check[30], c, n, a, xor_sum, ans;
^
./Main.c:1:18: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
check[30], c, n, a, xor_sum, ans;
^
./Main.c:1:21: warning: type defaults to ‘int’ in declaration of ‘xor_sum’ [-Wimplicit-int]
check[30], c, n, a, xor_sum, ans;
^
./Main.c:1:30: warning: type defaults to ‘int’ in declaration of ‘ans’ [-Wimplicit-int]
check[30], c, n, a, xor_sum, ans;
^
./Main.c: In function ‘main’:
./Main.c:4:9: warning: implicit declaration of function ‘getchar_unlocked’...