CodeForces 621A Wet Shark and Odd and Even
水题
#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的更多相关文章
- codeforce 621A Wet Shark and Odd and Even
水 最大偶数和 #include<iostream> #include<string> #include<algorithm> #include<cstdli ...
- 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 ...
- 【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 ...
- 【矩阵乘法优化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 ...
- Codeforces 612B. Wet Shark and Bishops 模拟
B. Wet Shark and Bishops time limit per test: 2 seconds memory limit per test: 256 megabytes input: ...
- 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 ...
- Codeforces Round #341 Div.2 A. Wet Shark and Odd and Even
题意是得到最大的偶数和 解决办法很简单 排个序 取和 如果是奇数就减去最小的奇数 #include <cstdio> #include <cmath> #include < ...
- CodeForces 621C Wet Shark and Flowers
方法可以转化一下,先计算每一个鲨鱼在自己范围内的数能被所给素数整除的个数有几个,从而得到能被整除的概率,设为f1,不能被整除的概率设为f2. 然后计算每相邻两只鲨鱼能获得钱的期望概率,f=w[id1] ...
- CodeForces 621B Wet Shark and Bishops
记录一下每个对角线上有几个,然后就可以算了 #include<cstdio> #include<cstring> #include<cmath> #include& ...
随机推荐
- Filter 解决web网页跳转乱码
为什么采用filter实现了字符集的统一编码 问题: 为什么会有字符集编码的问题呢?对于Java Web应用,使用Tomcat容器获取和传递的参数(request.getParameter())默认是 ...
- OpenGL ES着色器语言之操作数(官方文档第五章)
OpenGL ES着色器语言之操作数(官方文档第五章) 5.1操作数 OpenGL ES着色器语言包含如下操作符. 5.2数组下标 数组元素通过数组下标操作符([ ])进行访问.这是操作数组的唯一操作 ...
- margin叠加相邻两个元素的上下margin是叠加在一起
<!doctype html><html><head><meta charset="utf-8"><title>无标题文 ...
- elasticsearch高级配置之(二)----线程池设置
elasticsearch 配置 线程池 一个Elasticsearch节点会有多个线程池,但重要的是下面四个: 索引(index):主要是索引数据和删除数据操作(默认是cached类型) 搜索 ...
- This compilation unit is not on the build path SVN
This compilation unit is not on the build path of a Java project 解决办法 把项目导入STS(基于Eclipse)时,项目出现问题, ...
- java OPENCV 连通域, Imgproc.findContours 例子,参数说明
http://stackoverflow.com/questions/29491669/real-time-paper-sheet-detection-using-opencv-in-android/ ...
- hdu_5110_Alexandra and COS(DP+分块思想)
题目连接:hdu_5110_Alexandra and COS 题意: 给你一个图,X代表宝藏,然后有一个船,它的声纳的频率为D,定船到宝藏的距离为Dis=max(abs(x1-x2),abs(y1- ...
- css单独设定样式
<style type="text/css"> #footer { position: fixed; bottom: 0; } .td-right{ border-ri ...
- 将json转化为model
/// <summary> /// 获取Json的Model /// </summary> /// <typeparam name="T">&l ...
- WiresShark 图解教程1
Wireshark是世界上最流行的网络分析工具.这个强大的工具可以捕捉网络中的数据,并为用户提供关于网络和上层协议的各种信息.与很多其他网络工具一样,Wireshark也使用pcap network ...