300675: CF129A. Cookies

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Cookies

题意翻译

【题目描述】有n袋饼干( $1\le n\le 100$),每袋里有 $a_i(1\le a_i\le 100)$ 块饼干。拿走一袋饼干,使剩下的饼干数为偶数。求有多少种拿走的方案。 【输入格式】第一行是 $n(1\le n\le 100)$,第二行是 $n$ 个用空格隔开的数 $a_i(1\le a_i\le 100)$ 【输出格式】一个整数,即拿走饼干的方案。若不存在,输出0 感谢@面瘫者 提供的翻译

题目描述

Olga came to visit the twins Anna and Maria and saw that they have many cookies. The cookies are distributed into bags. As there are many cookies, Olga decided that it's no big deal if she steals a bag. However, she doesn't want the sisters to quarrel because of nothing when they divide the cookies. That's why Olga wants to steal a bag with cookies so that the number of cookies in the remaining bags was even, that is, so that Anna and Maria could evenly divide it into two (even 0 remaining cookies will do, just as any other even number). How many ways there are to steal exactly one cookie bag so that the total number of cookies in the remaining bags was even?

输入输出格式

输入格式


The first line contains the only integer $ n $ ( $ 1<=n<=100 $ ) — the number of cookie bags Anna and Maria have. The second line contains $ n $ integers $ a_{i} $ ( $ 1<=a_{i}<=100 $ ) — the number of cookies in the $ i $ -th bag.

输出格式


Print in the only line the only number — the sought number of ways. If there are no such ways print 0.

输入输出样例

输入样例 #1

1
1

输出样例 #1

1

输入样例 #2

10
1 2 2 3 4 4 4 2 2 2

输出样例 #2

8

输入样例 #3

11
2 2 2 2 2 2 2 2 2 2 99

输出样例 #3

1

说明

In the first sample Olga should take the only bag so that the twins ended up with the even number of cookies. In the second sample Olga can take any of five bags with two cookies or any of three bags with four cookies — $ 5+3=8 $ ways in total. In the third sample, no matter which bag with two cookies Olga chooses, the twins are left with $ 2*9+99=117 $ cookies. Thus, Olga has only one option: to take the bag with $ 99 $ cookies.

Input

题意翻译

【题目描述】有n袋饼干( $1\le n\le 100$),每袋里有 $a_i(1\le a_i\le 100)$ 块饼干。拿走一袋饼干,使剩下的饼干数为偶数。求有多少种拿走的方案。 【输入格式】第一行是 $n(1\le n\le 100)$,第二行是 $n$ 个用空格隔开的数 $a_i(1\le a_i\le 100)$ 【输出格式】一个整数,即拿走饼干的方案。若不存在,输出0 感谢@面瘫者 提供的翻译

加入题单

上一题 下一题 算法标签: