Description

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 00 and (2m−1)(2m−1) (inclusive).

As a young man born with ten fingers, he loves the powers of 1010 so much, which results in his eccentricity that he always ranges integers he would like to use from 11 to 10k10k (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 mm, satisfying 1≤m≤1051≤m≤105.
 

Output

For each test case, output " Case #xx: yy" in one line (without quotes), where xx indicates the case number starting from 11 and yy denotes the answer of corresponding case.
 
Sample

Sample Input

Sample Output
Case #:
Case #:

题意:

  给出10^k ≥ 2^m -1,求k的最大整数

思路:

  令10^k = 2^m 两边取对数,得 k = m*log10(2)的整数部分。

代码

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<math.h>
using namespace std;
int main()
{
int flag = ,n;
while(scanf("%d",&n)!=EOF)
{
int ans= (n*log10());
printf("Case #%d: %d\n",flag++,ans);
}
return ;
}

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. 2017ACM暑期多校联合训练 - Team 1 1001 HDU 6033 Add More Zero (数学)

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

  4. 2017"百度之星"程序设计大赛 - 复赛1003&&HDU 6146 Pokémon GO【数学,递推,dp】

    Pokémon GO Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  5. HDU 5810 Balls and Boxes 数学

    Balls and Boxes 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5810 Description Mr. Chopsticks is i ...

  6. hdu 1577 WisKey的眼神 (数学几何)

    WisKey的眼神 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  7. hdu - 3959 Board Game Dice(数学)

    这道题比赛中没做出来,赛后搞了好久才出来的,严重暴露的我薄弱的数学功底, 这道题要推公式的,,,有类似于1*a+2*a^2+3*a^3+...+n*a^n的数列求和. 最后画了一张纸才把最后的结果推出 ...

  8. HDU 5902 GCD is Funny 数学

    GCD is Funny 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5902 Description Alex has invented a ne ...

  9. hdu 4946 Just a Joke(数学+物理)

    链接:http://acm.hdu.edu.cn/showproblem.php?pid=4969 Just a Joke Time Limit: 2000/1000 MS (Java/Others) ...

随机推荐

  1. ecshop广告分析

    ecshop模板中,显示广告的库项目是ad_position.lbi,其内容只有一个语句: {insert name='ads' id=$ads_id num=$ads_num} smarty的ins ...

  2. An abandoned sentiment from past

    An abandoned sentiment from past time limit per test 1 second memory limit per test 256 megabytes in ...

  3. 字符串距离 简单DP

    字符串距离 时间限制: 1 Sec  内存限制: 128 MB 题目描述 设有字符串 X,我们称在 X 的头尾及中间插入任意多个空格后构成的新字符串为 X 的扩展串,如字符串 X 为"abc ...

  4. css实现选项卡

    <style> *{ margin: ; padding: ; text-decoration: none; list-style: none; outline:none; } .box{ ...

  5. java 父类构造器

    当创建任何java对象时,程序总会首先调用系统的父类非静态初始化块(隐式执行)和父类构造器(从object开始(java程序中所有类的最终父类都是java.lang.Object类,使用语句super ...

  6. AngularJS模块

    方式一: <body ng-app="myApp"> <div ng-controller="myCtrl1"> <h1>{ ...

  7. Linux系统网卡设置

    由于做了虚拟机的克隆,发现克隆机和被克隆机的MAC地址相同了,下面我将要介绍一下linux中网卡的配置步骤,我使用的linux是CentOS release 6.9 (Final) 1.root用户编 ...

  8. js-ES6学习笔记-Set结构和Map结构

    http://www.cnblogs.com/lonhon/ 1.ES6 提供了新的数据结构 Set.它类似于数组,但是成员的值都是唯一的,没有重复的值. Set 本身是一个构造函数,用来生成 Set ...

  9. JVM总结之GC

    哪些内存需要回收 在Java堆中存放着几乎所有的对象实例,垃圾收集器在对堆进行回收前,第一件事情就是要知道哪些对象还"存活着",哪些对象已经"死去". 引用计数 ...

  10. VB6之HTTP服务器的实现

    之前用VBS写过一个,效率和支持比较low,这次闲着没事用VB重写了一次. 当前的实现版本仅支持静态文件的访问(*.html之类),支持访问方式为GET,HTTP状态支持200和404. 两个文件,一 ...