B 石子
抱着混分的心态写的代码,但经过几次模拟之后发现,是很难获胜的,因为至少取一个,还得是偶数。集中情况试了试,发现只有当石子是一堆,且石子数量为偶数的时候,
为必胜。
while True:
try:
n = int(input())
lst = list(map(int , input().split()))
if n == 1:
if lst[0]&1:
print("NO")
else:
print("YES")
elif lst.count(1) == n:
print("NO")
else:
print("NO")
except:
break 
京公网安备 11010502036488号