在培养皿中,每个细胞每天会繁殖,数量*2
我们可以在任意天加入任意数量的细胞入培养皿中。
想要知道最少加入多少个细胞,可以使得有一天,培养皿中细胞的数量会恰好为x

其实就是输出X的二进制中有多少个1

Sample test(s)
input
5
output
2
input
8
output
1

 # include <iostream>
# include <cstdio>
# include <cstring>
# include <algorithm>
# include <string>
# include <cmath>
# include <queue>
# include <list>
# define LL long long
using namespace std ; int main()
{
//freopen("in.txt","r",stdin) ;
int n ;
while(scanf("%d",&n) != EOF)
{
int sum = ;
while(n)
{
if (n & )
sum++ ;
n >>= ;
}
printf("%d\n" , sum) ;
} return ;
}

最新文章

  1. linux mount/umount挂载命令解析。
  2. 安全测试 - XSS如何防御
  3. Python迭代器,可迭代对象,生成器
  4. jquery为新增元素添加事件
  5. Tomcat+eclipse JSP windows开发环境配置
  6. BI案例:某公司BI系统的九大主题分析
  7. Jquery基础:append、prepend、after、before、appendTo的区别
  8. REST内容协商注解
  9. 导航控制器生产,push,pop,root,index
  10. nginx安装与应用
  11. 终于知道如何使Tab控件的不出现白边的方法了
  12. C# 处理Word自动生成报告 三、设计模板
  13. vue 项目中引用百度地图
  14. tomcat catalina.out乱码
  15. Spring_AOP 实现原理与 CGLIB 应用
  16. 微软Azure AspNetCore微服务实战 第二期
  17. sga 操作命令
  18. zookeeper3.4.5+Hbase1.2.6安装教程
  19. 【jdk源码1】TreeMap源码学习
  20. asp.net Ibatis.net 批量插入数据ORACLE

热门文章

  1. css基础--常用css属性01
  2. Python【OS】模块
  3. Python【第三方模块&amp;标准模块】
  4. 批量打回未报bug修复
  5. 科学计算三维可视化---TVTK入门(安装与测试)
  6. mongo查询日期格式数据
  7. 【Foreign】Rectangle [KD-tree]
  8. JQuery获取被选中的checkbox的value值
  9. vue-cli环境搭建初探!
  10. UNIX环境高级编程 第4章 文件和目录