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& ...
随机推荐
- make module失败的原因cc1: error: unrecognized command line option “-m64
cc1: error: unrecognized command line option "-m64"cc1: error: unrecognized command line o ...
- MySQL SQL优化——分片搜索
DELIMITER $$ DROP PROCEDURE IF EXISTS `test_release`.`Sp_JP_A_NotifyBegin`$$ CREATE DEFINER=`encysys ...
- coco2d-x CCDirector.h文件中变量*m_pNotificationNode*
1.在CCDiretor.h中有如下说明 /** This object will be visited after the main scene is visited. This object MU ...
- 最近关于ACM训练与算法的总结
到了大四以后越来越意识到基础知识的重要性,很多高屋建瓴的观点与想法都是建立在坚实的基础之上的, 招式只有在强劲的内力下才能发挥最大的作用,曾经有段时间我有这样的想法:我们出去以后和其他 ...
- php moungoDB
moungoDB 语法 SQL查询语句 Mongo查询语句 CREATE TABLE USERS (a Number, b Number) 隐式的创建,或 MongoDB::createCollect ...
- Java NIO Related
A file's status is 3-valued: The file is verified to exist; The file is verified to not exist; The f ...
- linux内核移植到S5pv210
make s5pv210_defconfig 1.System Type ---> (0) S3C UART to use for low-level messages 2.Kernel ha ...
- android笔记20170116
封装http请求类,利用回调机制获取返回值 public interface HttpCallbackListener { void onFinish(String response); void o ...
- bootstrap's plugin:sthe usage of carousel
if we want use the carousel.js,we need quote it in the page. sample code: <div id="myCarouse ...
- [IDL入门] 两个PPT,IDL上手
首先看看IDL能干什么,<Solving Real Problems with Computer Graphics>ppt是英文的,很精彩. 下载地址:http://pan.baidu.c ...