Problems
Contests
Events
Topic
IDE
PacketHub
Login
Description
Editorial
My Submission
1073.Cookies
Look up all submission
Status
Time
Memory
Lang.
Submit Date
1073.Cookies
Time Limit:1000MS Memory Limit:65535KB
Description
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?
Input
The input consists of several test cases. 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. Process to the end of file.
Output
Print in the only line the only number --- the sought number of ways. If there are no such ways print 0.
Sample test
Sample input
1 1 10 1 2 2 3 4 4 4 2 2 2 2 1 1
Sample output
1 8 0
Note
Tags
implementation
Post editorial
Editorials
GNU C++ 9.3.0
GNU C 9.3.0
Java 1.8
Python 3.8.4
Lua 5.3
GO 1.12.4
JS - (nodejs 10.19.0)
Login before submit
Test Input
Test Output
1 1 10 1 2 2 3 4 4 4 2 2 2 2 1 1
Please run you code firstly.
Console
IDE Setting
字体设置
调整适合你的字体大小。
12px
13px
14px
15px
16px
18px
20px
主题设置
切换不同的代码编辑器主题,选择适合你的语法高亮。
Visual Studio
Visual Studio Dark
High Contrast Dark
行宽限制
设置每一行代码的最大字符个数,设置为0则不限制。
0
80
100
120