水题

#include<cstdio>
#include<cstring>
#include<cmath>
#include<ctime>
#include<vector>
#include<algorithm>
using namespace std; int n;
long long a[+]; int main()
{
scanf("%d",&n);
for(int i=;i<n;i++) scanf("%lld",&a[i]);
sort(a,a+n); long long ans1=,ans2=,num=;
for(int i=;i<n;i++)
{
if(a[i]%==) ans1=ans1+a[i];
else ans2=ans2+a[i],num++;
}
if(num%==) printf("%lld\n",ans1+ans2);
else
{
for(int i=;i<n;i++)
if(a[i]%==)
{ans2=ans2-a[i];break;}
printf("%lld\n",ans1+ans2);
}
return ;
}

CodeForces 621A Wet Shark and Odd and Even的更多相关文章

  1. codeforce 621A Wet Shark and Odd and Even

    水 最大偶数和 #include<iostream> #include<string> #include<algorithm> #include<cstdli ...

  2. cf-A. Wet Shark and Odd and Even(水)

    A. Wet Shark and Odd and Even time limit per test 2 seconds memory limit per test 256 megabytes inpu ...

  3. 【CodeForces 621A】Wet Shark and Odd and Even

    题 Today, Wet Shark is given n integers. Using any of these integers no more than once, Wet Shark wan ...

  4. 【矩阵乘法优化dp】[Codeforces 621E] Wet Shark and Blocks

    http://codeforces.com/problemset/problem/621/E E. Wet Shark and Blocks time limit per test 2 seconds ...

  5. Codeforces 612B. Wet Shark and Bishops 模拟

    B. Wet Shark and Bishops time limit per test: 2 seconds memory limit per test: 256 megabytes input: ...

  6. CODEFORCEs 621E. Wet Shark and Blocks

    E. Wet Shark and Blocks time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  7. Codeforces Round #341 Div.2 A. Wet Shark and Odd and Even

    题意是得到最大的偶数和 解决办法很简单 排个序 取和 如果是奇数就减去最小的奇数 #include <cstdio> #include <cmath> #include < ...

  8. CodeForces 621C Wet Shark and Flowers

    方法可以转化一下,先计算每一个鲨鱼在自己范围内的数能被所给素数整除的个数有几个,从而得到能被整除的概率,设为f1,不能被整除的概率设为f2. 然后计算每相邻两只鲨鱼能获得钱的期望概率,f=w[id1] ...

  9. CodeForces 621B Wet Shark and Bishops

    记录一下每个对角线上有几个,然后就可以算了 #include<cstdio> #include<cstring> #include<cmath> #include& ...

随机推荐

  1. 笨方法学python--安装和准备

    1 下载并安装python http://python.org/download 下载python2.7. python2.7并不是python3.5的旧版本. python2现在应用较广,网上资料较 ...

  2. Java学习笔记之I/O

    package com.chinasofti.javase20160819; import java.io.BufferedReader; import java.io.BufferedWriter; ...

  3. MyBatis SQL配置文件中使用#{}取值为null时却不报错的解决方案。

    原因是因为#{kh_id} 这个参数名为小写,我之前写成了大写{#KH_ID}所以取不到值

  4. html 7.28

    1.HTML标记在没有添加任何样式的时候,默认是有间距的,所以我们要先把把所有标记归置内(padding)外(margin)边距归置为0 2.HTML5 中不支持 <acronym> 标签 ...

  5. 8--UI 初步认识 简易计算器

    UI是App的根基:一个App应该是先有UI界面,然后在UI的基础上增加实用功能(2)UI相对简单易学:UI普遍是学习过程中最简单的一块,能快速拥有成就感和学习兴趣(3)UI至关重要:开发中的绝大部分 ...

  6. android性能优化优秀文章

    郭霖最近整理的文章: 合理管理内存 分析编码过程中如何避免过多内存占用,以及如何实现高性能的内存使用. 尽可能使用intentService; 当界面不可见时释放内存; 当内存紧张时释放内存; 避免b ...

  7. YII2 过滤器 filters

    使用过滤器 过滤器本质上是一类特殊的 行为,所以使用过滤器和 使用 行为一样. 可以在控制器类中覆盖它的 yii\base\Controller::behaviors() 方法来申明过滤器, 如下所示 ...

  8. Friends and Subsequences

    Friends and Subsequences Mike and !Mike are old childhood rivals, they are opposite in everything th ...

  9. android脚步---Itent.ACTION_PICK ,startActivityForResult

    public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(Intent.A ...

  10. iOS项目在非测试设备上的安装方法(项目上线前)

    转载自:http://blog.csdn.net/ai379558502/article/details/49003383 方法一: 这个办法,其实是国外一个创业项目 TestFlight,面向移动应 ...