There is a youngster known for amateur propositions concerning several mathematical hard problems.

Nowadays, he is preparing a thought-provoking problem on a specific type of supercomputer which has ability to support calculations of integers between 0 and (2m−1) (inclusive).

As a young man born with ten fingers, he loves the powers of 10 so much, which results in his eccentricity that he always ranges integers he would like to use from 1to 10k (inclusive).

For the sake of processing, all integers he would use possibly in this interesting problem ought to be as computable as this supercomputer could.

Given the positive integer m, your task is to determine maximum possible integer k that is suitable for the specific supercomputer.

 
Input
The input contains multiple test cases. Each test case in one line contains only one positive integer m, satisfying 1≤m≤105.
 
Output
For each test case, output "Case #x: y" in one line (without quotes), where x indicates the case number starting from 1 and y denotes the answer of corresponding case.
 
Sample Input
1
64
 
Sample Output
Case #1: 0
Case #2: 19
 
有一台计算机,它可以计算从0~2m-1的所有数,一个年轻人喜欢10k,所以他希望你能告诉他在给定的m下,能使10k满足条件的K的最大值。
差不多这个意思吧...
那么把10k中k可以看成是2m-1的位数-1。即求解2m-1的位数即可。

#include<iostream>
#include<math.h>
#define LG 0.30102999566
using namespace std;
int main()
{
int a;
double m;
a=;
while(cin>>m)
{
cout<<"Case #"<<a++<<": ";
cout<<(int)(m*LG)<<endl;
}
}

HDU-6033 Add More Zero的更多相关文章

  1. HDU 6033 - Add More Zero | 2017 Multi-University Training Contest 1

    /* HDU 6033 - Add More Zero [ 简单公式 ] | 2017 Multi-University Training Contest 1 题意: 问 2^n-1 有几位 分析: ...

  2. 2017 Multi-University Training Contest - Team 1 1001&&HDU 6033 Add More Zero【签到题,数学,水】

    Add More Zero Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)T ...

  3. HDU 6033 Add More Zero (数学)

    Description There is a youngster known for amateur propositions concerning several mathematical hard ...

  4. 2017ACM暑期多校联合训练 - Team 1 1001 HDU 6033 Add More Zero (数学)

    题目链接 Problem Description There is a youngster known for amateur propositions concerning several math ...

  5. HDU 2162 Add ‘em

    http://acm.hdu.edu.cn/showproblem.php?pid=2162 Problem Description Write a program to determine the ...

  6. HDOJ(HDU) 2162 Add ‘em(求和)

    Problem Description Write a program to determine the summation of several sets of integers. Input Th ...

  7. HDU 多校联合 6033 6043

    http://acm.hdu.edu.cn/showproblem.php?pid=6033 Add More Zero Time Limit: 2000/1000 MS (Java/Others)  ...

  8. 2017 Multi-University Training Contest - 1

    hdu 6033 pragma comment(linker, "/STACK:102400000,102400000") #include <cstdio> #inc ...

  9. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  10. HDU 2586

    http://acm.hdu.edu.cn/showproblem.php?pid=2586 题意:求最近祖先节点的权值和 思路:LCA Tarjan算法 #include <stdio.h&g ...

随机推荐

  1. 【Hadoop学习之九】MapReduce案例分析一-天气

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk8 hadoop-3.1.1 找出每个月气温最高的2天 1949 ...

  2. Spring源码阅读(六)

    这一讲分析spring bean属性注入代码populateBean,源码分析如下 /** * Populate the bean instance in the given BeanWrapper ...

  3. 20165305 苏振龙《Java程序设计》第一周学习总结

    20165305 <Java程序设计>第一周学习总结 教材学习内容总结 我重点学习了jdk安装后面的第一章内容,算是更进一步的的了解了一些Java方面的基础知识. Java平台概论 Jav ...

  4. python 列表推导

    废话不多说,直接上代码 #coding=utf-8 def getitem(index, element): return '%d: %s' % (index, element) def getite ...

  5. php获取字符串长度函数strlen和mb_strlen

    php获取字符串长度函数strlen和mb_strlencount() - 计算数组中的单元数目,或对象中的属性个数strlen — 获取字符串长度,一个汉字为3个字符mb_strlen() - 获取 ...

  6. Lucene 个人领悟 (二)

    想了想,还是继续写吧,因为,太无聊了,媳妇儿也还有半个小时才下班. 前面拖拖拉拉用了三篇文章来做铺垫,这一篇开始正经搞了啊. 首先,我要加几个链接 http://www.cnblogs.com/xin ...

  7. 使用Holer远程桌面登录家里电脑和公司内网电脑

    1. Holer工具简介 Holer exposes local servers behind NATs and firewalls to the public internet over secur ...

  8. RTP协议全解析(H264码流和PS流)(转)

    源: RTP协议全解析(H264码流和PS流)

  9. django 表单常用field

    BooleanField字段:相当于单选框 CharField:接受字符串 参数:max_length最大长度,min_length最小长度 require字段是否是必须的,默认为required=T ...

  10. centos6安装多实例mysql

    centos 6.5,使用二进制安装多实例mysql 5.5.60 所需安装包mysql-5.5.60-linux-glibc2.12-x86_64.tar.gz.ncurses-devel-5.7- ...