CF59B.Fortune Telling
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces alternatively "Loves" and "Doesn't love", at that Marina always starts with "Loves". There are n camomiles growing in the field, possessing the numbers of petals equal to _a_1, _a_2, ... a__n. Marina wants to pick a bouquet with the maximal possible total number of petals so that the result would still be "Loves". Help her do that; find the maximal number of petals possible in the bouquet.
玛琳娜爱着萨沙。但她一直在疑惑萨沙是否也爱她。当然,最可靠的方法是占卜。占卜的方式有很多,但玛琳娜选择了最简单的一种:她手中拿一朵或多朵洋甘菊,然后依次撕下每一片花瓣;每撕下一片花瓣,她就交替说出“爱”和“不爱”,且总是从“爱”开始。田野里共有 n 朵洋甘菊,它们的花瓣数分别为 a1,a2,…,an。玛琳娜希望采摘一束花,使其总花瓣数尽可能多,同时最终结果仍为“爱”。请帮她实现这一目标;求出该花束可能拥有的最大花瓣总数。
输入格式
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers a__i (1 ≤ a__i ≤ 100) which represent the number of petals on a given i-th camomile.
第一行包含一个整数 n(1≤n≤100),表示田地中生长的雏菊数量。
第二行包含 n 个整数 ai(1≤ai≤100),表示第 i 朵雏菊的花瓣数量。
输出格式
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
输出一个整数,表示能够得到“爱”(Loves)这一占卜结果的花束中最多包含的花瓣数。如果不存在这样的花束,则输出 0。该花束可以仅由一朵花组成。
输入输出样例
输入#1
1 1
输出#1
1
输入#2
1 2
输出#2
0
输入#3
3 5 6 7
输出#3
13
输入解题思路,AI测评打分。不知道怎么写?