【题解】:二进制拆分

    任意一个整数都可以拆分成 2^0 + 2^1 + 2^2 + 2^3 + ....+ m

【code】:

 #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h> using namespace std; int main()
{
int n;
while(~scanf("%d",&n))
{
int i,sum=;
for(i=;;i++)
{
sum+=pow(,i);
if(sum>=n)
{
break;
}
}
printf("%d\n",i+);
}
return ;
}

Contest2037 - CSU Monthly 2013 Oct (problem A :Small change)的更多相关文章

  1. Contest2037 - CSU Monthly 2013 Oct (problem F :ZZY and his little friends)

    http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=5 [题解]: 没想通这题暴力可以过.... [code]: #inclu ...

  2. Contest2037 - CSU Monthly 2013 Oct (problem B :Scoop water)

    http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=1 [题解]:卡特兰数取模 h(n) = h(n-1)*(4*n-2)/( ...

  3. Contest2037 - CSU Monthly 2013 Oct (problem D :CX and girls)

    [题解]: 最短路径问题,保证距离最短的同时,学妹权值最大,哈哈 [code]: #include<iostream> #include<queue> #include< ...

  4. Contest2037 - CSU Monthly 2013 Oct (Problem J: Scholarship)

    http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=9 [题解]: 这题卡了一下,卡在负数的情况,负数输出 0 这题主要找到一 ...

  5. Contest2037 - CSU Monthly 2013 Oct(中南大学2013年10月月赛水题部分题解)

    Problem A: Small change 题解:http://www.cnblogs.com/crazyapple/p/3349469.html Problem B: Scoop water 题 ...

  6. 移动设备和SharePoint 2013 - 第5部分:自定义应用

    博客地址:http://blog.csdn.net/foxdave 原文地址 在该系列文章中,作者展示了SharePoint 2013最显著的新功能概观--对移动设备的支持. 该系列文章: 移动设备和 ...

  7. 移动设备和SharePoint 2013 - 第4部分:定位

    博客地址:http://blog.csdn.net/foxdave 原文地址 在该系列文章中,作者展示了SharePoint 2013最显著的新功能概观--对移动设备的支持. 该系列文章: 移动设备和 ...

  8. 移动设备和SharePoint 2013 - 第3部分:推送通知

    博客地址:http://blog.csdn.net/foxdave 原文地址 在该系列文章中,作者展示了SharePoint 2013最显著的新功能概观--对移动设备的支持. 该系列文章: 移动设备和 ...

  9. 移动设备和SharePoint 2013 - 第2部分:设备管道和SharePoint页面模型

    博客地址:http://blog.csdn.net/foxdave 原文地址 在该系列文章中,作者展示了SharePoint 2013最显著的新功能概观--对移动设备的支持. 该系列文章: 移动设备和 ...

随机推荐

  1. Laravel_Elixir_gulp任务利器安装

    目录 说明 安装 1安装gulp 2安装Elixir 3Elixir快速入门 4合并cssjs 5版本控制version 6复制copy 7方法串联 1.说明 详细说明暂时省略,后期补充.小白的角度理 ...

  2. ActiveMQ 的安装

    1. 在 http://activemq.apache.org/ 下载 ActiveMQ.Windows 系统选择下载 apache-activemq-x.x.x-bin.zip,Unix/Linux ...

  3. Redis 命令 - Strings

    APPEND key value Available since 2.0.0, Time complexity: O(1). Append a value to a key 127.0.0.1:637 ...

  4. 关于easyui的一些小知识点(1)

    让layout布局自动适应浏览器宽度只需要加上fit="true"属性.

  5. 转:SqlServer2008误操作数据(delete或者update)后恢复数据

    Sqlserver2008误操作数据(delete或者update)后恢复数据(转) 实际工作中,有时会直接在数据库中操作数据,比如对数据进行delete或者update操作,当进行这些操作的时候,如 ...

  6. sqlserver 公有表达式

    了解通用表达式: 为了让代码简洁:在一个查询中引用另外的结果集都是通过视图而不是子查询来进行分解,但是视图是系统级对象,如果数据集仅仅需要在存储过程或是自定义函数中使用一次的话,使用view有些奢侈哈 ...

  7. Cocos2d-x手机游戏开发中-组合动作

    动作往往不是单一,而是复杂的组合.我们可以按照一定的次序将上述基本动作组合起来,形成连贯的一套组合动作.组合动作包括以下几类:顺序.并列.有限次数重复.无限次数重复.反动作和动画.动画我们会在下一节介 ...

  8. 利用图层的mask属性裁剪图形

    需求如上图. 代码如下 //充值 UIButton *rechargeButton = [[UIButton alloc] initWithFrame:CGRectMake(, , , )]; [re ...

  9. 【leetcode】10.Regular Expression Matching

    题目描述: Implement regular expression matching with support for '.' and '*'. '.' Matches any single cha ...

  10. 方法:查询MongoDB数据库中最新一条数据(JAVA)

    使用JAVA语言查询MongoDB中某个数据库某个集合的最新一条数据: MongoCollection<Document> cpu = MongoClient.getDatabase(&q ...