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. 大数据处理框架之Strom:Storm集群环境搭建

    搭建环境 Red Hat Enterprise Linux Server release 7.3 (Maipo)      zookeeper-3.4.11 jdk1.7.0_80      Pyth ...

  2. HTTPS 之共享秘钥 公钥 及 私钥

    HTTPS 之共享秘钥 公钥 及 私钥一 共享秘钥1.1 概念共享秘钥和我们生活中同一把锁的钥匙概念类似,对同一把锁来说,加锁时使用什么钥匙,解锁也必须使用同样的钥匙. 1.2 共享秘钥在HTTP传输 ...

  3. 将jar包制作成docker镜像

    将jar包制作成docker镜像1.准备可运行jar包2.建立Dockerfile文件 文件内容: FROM java:8VOLUME /tmpADD xxx-sendemail-0.0.1-SNAP ...

  4. 关于Ajax无法下载文件到浏览器本地的问题

    最近在做网站的时候遇到这样一个功能,在如图所示的页面中,需要用户点击链接的时候,能够以异步Ajax的方式判断服务器中是否存储有相应的Excel文件,如果没有的话就提示用户没有找到,如果有的话就下载到用 ...

  5. Python3自定义日志类 mylog

    #encoding=utf-8 import os, sysimport datetimeimport time class Mylog(object): # 根文件夹    root_dir = s ...

  6. JAVA基本语法测试

    一: 1,JAVA的基本运行单位是类 2,类的成员:成员变量,构造方法,普通方法和内部类 3,成员变量种类:字符类型:char        布尔类型:boolean     数值类型:byte, s ...

  7. Java用Gson遍历json所有节点

    <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</ar ...

  8. django 函数装饰器 变为 类装饰器

    aaa  

  9. BeanUtils工具的使用

    beanutils的下载地址:http://commons.apache.org/proper/commons-beanutils/download_beanutils.cgi 该压缩包有测试的代码: ...

  10. bzoj4566 / P3181 [HAOI2016]找相同字符

    P3181 [HAOI2016]找相同字符 后缀自动机 (正解应是广义后缀自动机) 并不会广义后缀自动机. 然鹅可以用普通的后缀自动机.   我们先引入一个问题:算出从一个串内取任意两个不重合子串完全 ...