'commit'
This commit is contained in:
23
TangDou/AcWing_TiGao/T5/GameTheory/HDU1850.cpp
Normal file
23
TangDou/AcWing_TiGao/T5/GameTheory/HDU1850.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user