题意:一数列an,如果存在一个k,有2^(ai)+2^(aj)+......=2^k成立,那么一次能拿走ai,aj这些全部。问最少拿的次数。

太简单。

乱码

//#pragma comment(linker,"/STACK:1024000000,1024000000")
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include <stack>
#include <ctime>
#include <iomanip>
using namespace std;
const int SZ=,INF=0x7FFFFFFF;
typedef long long lon;
lon num[SZ]; int main()
{
std::ios::sync_with_stdio();
//freopen("d:\\1.txt","r",stdin);
int n;
//for(;cin>>n,n;)
{
cin>>n;
for(int i=;i<n;++i)
{
int tmp;
cin>>tmp;
++num[tmp];
}
for(int i=;i<SZ;++i)
{
num[i+]+=num[i]/;
num[i]=(num[i]&);
}
// for(int i=0;i<SZ;++i)
// {
// if(num[i])cout<<i<<" ";
// }cout<<endl;
int res=count(num,num+SZ,);
cout<<res<<endl;
}
return ;
}

codeforces587a//Duff and Weight Lifting// Codeforces Round #326 (Div. 1)的更多相关文章

  1. Codeforces Round #326 (Div. 2) C. Duff and Weight Lifting 水题

    C. Duff and Weight Lifting Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...

  2. Codeforces Round #326 (Div. 2) B. Pasha and Phone C. Duff and Weight Lifting

    B. Pasha and PhonePasha has recently bought a new phone jPager and started adding his friends' phone ...

  3. Codeforces Round #326 (Div. 2) D. Duff in Beach dp

    D. Duff in Beach Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/probl ...

  4. Codeforces Round #326 (Div. 2) B. Duff in Love 分解质因数

    B. Duff in Love Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/proble ...

  5. Codeforces Round #326 (Div. 2) A. Duff and Meat 水题

    A. Duff and Meat Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/probl ...

  6. Codeforces Round #326 (Div. 2)-Duff and Meat

    题意: Duff每天要吃ai千克肉,这天肉的价格为pi(这天可以买好多好多肉),现在给你一个数值n为Duff吃肉的天数,求出用最少的钱满足Duff的条件. 思路: 只要判断相邻两天中,今天的总花费 = ...

  7. 「日常训练」Duff in the Army (Codeforces Round #326 Div.2 E)

    题意(CodeForces 588E) 给定一棵\(n\)个点的树,给定\(m\)个人(\(m\le n\))在哪个点上的信息,每个点可以有任意个人:然后给\(q\)个询问,每次问\(u\)到\(v\ ...

  8. Codeforces Round #326 (Div. 2) B Duff in Love 简单数论 姿势涨

    B. Duff in Love time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...

  9. Codeforces Round #326 (Div. 2)-Duff in Love

    题意: 一个数x被定义为lovely number需要满足这样的条件:不存在一个数a(a>1),使得a的完全平方是x的因子(即x % a2  != 0). 给你一个数n,求出n的因子中为love ...

随机推荐

  1. Oracle错误——ORA-12704:字符集不匹配

    错误 在查询使用coalesce把字符串进行转换时,报错ORA-12704:字符集不匹配 如下图 解决方法 在网上找了很多方法,有使用Translate转换的:有使用to_char()的,经过测试不符 ...

  2. uniGUI试用笔记(九)

    uniGUI执行程序部署有3种形式 1.ISAPI模式 部署在IIS或Apache,程序编译为Dll形式,没有试,准备后续专门测试一下. 2.标准执行文件模式 将软件编译成一个独立的Exe文件,包括了 ...

  3. 2018 蓝桥杯省赛 B 组模拟赛(五)

    A模拟 代码1 #include<bits/stdc++.h> using namespace std; int n = 101; int a[120][120]; int ans = 0 ...

  4. C# 各种控件实现可拖动和调整大小

    http://www.360doc.com/content/18/0516/12/55659281_754382494.shtml using System; using System.Collect ...

  5. HDU 1465 不容易系列之一

    扯淡 貌似有傻逼的做法XD 话说我没开long long,忘读入n,忘了清零ans WA了三遍是什么操作啊 傻了傻了 思路 显然是一个错排问题啊XD 但是我们不套公式,我们用一发二项式反演 二项式反演 ...

  6. 4-Four-Seeing hands

      ①Several cases have been reported in Russia recently of people who can read and detect colours wit ...

  7. Python 安装与环境变量配置

    一.软件下载 Python安装包下载地址:https://www.python.org/ 二.安装过程(略) 三.环境变量配置: 方法一:使用cmd命令添加path环境变量 在cmd下输入: path ...

  8. 【Hadoop 分布式部署 六:环境问题解决和集群基准测试】

    环境问题: 出现Temporary  failure  in  name  resolutionp-senior-zuoyan.com 的原因有很多,主要就是主机没有解析到, 那就在hadoop的sl ...

  9. 3、Python函数详解(0601)

    回顾: re search,findall,finditer.sub,subn function ()    调用函数 def func_name(arg1,....)   生成函数对象 func_s ...

  10. ArcGis连接oracle、oracle配置

    服务器:Oracle 11g(我是默认路径安装,自定义路径没成功,不知道为什么) 客户端:arcgis desktop 10.2.oracle 11g 32位客户端 客户端:arcgis server ...