题目地址:http://codevs.cn/problem/1037/
分析:
贪心
代码:
var
a:array[1..20] of longint;
n,i,j,min1,min2:longint;
begin
readln(n);
for i:=1 to n do read(a[i]);
for i:=1 to n do if(a[i]=0)then begin min1:=i-1;break;end;
for i:=n downto 1 do if(a[i]=0)then begin min2:=n-i;break;end;
if(min1 mod 2=0)and(min2 mod 2=0)then writeln('NO')else writeln('YES');
end.