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. Spark学习之路 (九)SparkCore的调优之数据倾斜调优

    摘抄自:https://tech.meituan.com/spark-tuning-pro.html 数据倾斜调优 调优概述 有的时候,我们可能会遇到大数据计算中一个最棘手的问题——数据倾斜,此时Sp ...

  2. 【Linux学习七】软件安装

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 一.编译安装1.解压 源码文件是压缩包 要先解压tar -zxvf t ...

  3. C# 选项卡控件

    选项卡控件,它提供一系列操作按钮,单击不同的按钮可以在各个页面之间进行切换. 在Windows Form应用程序中,选项卡控件即“TebPage”控件,它公开“TebPage”属性,表示一个由“Tab ...

  4. react系列笔记1 用npx npm命令创建react app

    react系列笔记1 用npx npm命令创建react app create-react-app my-app是开始构建新的 React 单页应用程序的最佳方式.它已经为你设置好了开发环境,以便您可 ...

  5. linux下SVN忽略指定文件/文件夹

    http://www.cnblogs.com/fjping0606/p/4743009.html 1.配置SVN默认编辑器vi ~/.bash_profile最后一行加上:export SVN_EDI ...

  6. Golang并发编程中select简单了解

    select可以监听channel的数据流动select的用法与switch语法非常类似,由select开始的一个新的选择块,每个选择条件由case语句来描述 与switch语句可以选择任何使用相等比 ...

  7. tcp编程 示例

    #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <net ...

  8. udp丢包 处理

    转自: 自己在做UDP传输时遇到的问题,接收端没设置缓存,结果总是丢包. 看到这篇文章设置了一下接收缓存就好 *;//设置为32K setsockopt(s,SOL_SOCKET,SO_RCVBUF, ...

  9. Program terminated with signal 6, Aborted,有可能啥原因呢?

    Program terminated with signal 6, Aborted,有可能啥原因呢?其中一种原因就是事实上的OOM(虽然/var/log/message中没有标明操作系统kill了进行 ...

  10. MyBatis 与 Hibernate 到底哪个更快?

    前言 由于编程思想与数据库的设计模式不同,生出了一些ORM框架. 核心都是将关系型数据库和数据转成对象型.当前流行的方案有Hibernate与myBatis. 两者各有优劣.竞争激烈,其中一个比较重要 ...