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.
35 lines
634 B
35 lines
634 B
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
const int N = 110;
|
|
|
|
int n;
|
|
int f[N];
|
|
int res;
|
|
|
|
int sg(int x) {
|
|
if (~f[x]) return f[x];
|
|
unordered_set<int> S;
|
|
// 所有能到的局面
|
|
for (int i = 0; i < x; i++)
|
|
for (int j = 0; j <= i; j++)
|
|
S.insert(sg(i) ^ sg(j));
|
|
|
|
for (int i = 0;; i++)
|
|
if (!S.count(i)) return f[x] = i;
|
|
}
|
|
|
|
int main() {
|
|
// 初始化
|
|
memset(f, -1, sizeof f);
|
|
cin >> n;
|
|
while (n--) {
|
|
int x;
|
|
cin >> x;
|
|
res ^= sg(x);
|
|
}
|
|
if (res)
|
|
puts("Yes");
|
|
else
|
|
puts("No");
|
|
return 0;
|
|
} |