1. 程式人生 > >luogu_1288 取數遊戲II

luogu_1288 取數遊戲II

namespace esp brush log using mes while sca for

#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int n,a[30*2],sum,sum1,cnt=1;

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){scanf("%d",&a[i]);}
	while(a[cnt]!=0){sum++; cnt++;}
	cnt=n;
	while(a[cnt]!=0){sum1++; cnt--;}
	if(sum%2==1 || sum1%2==1)puts("YES");
	else puts("NO");
	return 0;
}

  

luogu_1288 取數遊戲II