HDU 6033 Add More Zero (数学)
Description
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
Output
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 (数学)的更多相关文章
- 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 有几位 分析: ...
- 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 ...
- 2017ACM暑期多校联合训练 - Team 1 1001 HDU 6033 Add More Zero (数学)
题目链接 Problem Description There is a youngster known for amateur propositions concerning several math ...
- 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 ...
- HDU 5810 Balls and Boxes 数学
Balls and Boxes 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5810 Description Mr. Chopsticks is i ...
- hdu 1577 WisKey的眼神 (数学几何)
WisKey的眼神 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- hdu - 3959 Board Game Dice(数学)
这道题比赛中没做出来,赛后搞了好久才出来的,严重暴露的我薄弱的数学功底, 这道题要推公式的,,,有类似于1*a+2*a^2+3*a^3+...+n*a^n的数列求和. 最后画了一张纸才把最后的结果推出 ...
- HDU 5902 GCD is Funny 数学
GCD is Funny 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5902 Description Alex has invented a ne ...
- hdu 4946 Just a Joke(数学+物理)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4969 Just a Joke Time Limit: 2000/1000 MS (Java/Others) ...
随机推荐
- python 遍历列表 list
names=['a','b',['aha',[['lucy','lily']]] 遍历这个列表 def print_list(this_list); for name in this_list: if ...
- Docker Machine 详解
笔者在<Docker Machine 简介>一文中简单介绍了 Docker Machine 及其基本用法,但是忽略的细节实在是太多了.比如 Docker 与 Docker Machine ...
- java中方法总结(每周更新)
1.URLEncoder.encode(username,"utf-8")将"utf-8"编码的username先解码,然后再采用URL编码 2.URLDeco ...
- javascript 闭包 转载
http://www.jb51.net/article/24101.htm var name = "the window"; var object = { name:"m ...
- 细说Nullable<T>类型
目录一.简介二.语法和用法三.类型的转换和运算四.装箱与拆箱五.GetType()方法六.ToString()方法七.System.Nullable帮助类八.语法糖 一.简介 众所周知,值类型变量不能 ...
- selenium webDriver给隐藏域赋值 input hidden set value
//直接这样无法给input hidden赋值// driver.findElement(By.id("image_default")).sendKeys("a1112. ...
- 学会git玩转github,结尾有惊喜!有惊喜!有惊喜!
一.什么是Github Github是全球最大的社交编程及代码托管网站(https://github.com/). Github可以托管各种git库,并提供一个web界面(用户名.github.io/ ...
- js 监控iframe URL的变化
iframe的url可以前端任何地址,这样就可能出现漏洞,如果钓鱼网站通过js把src改成了危险地址,如果没有监控,就会有很大隐患.所以监控iframe的url变化就是必须要解决的问题了. 第一印象的 ...
- 在linux环境下tomcat 指定 jdk或jre版本
最近在服务器上部署的服务出了点问题,后来查到是因为JDK版本太高了,程序识别不了,需要把JDK降级. 但是服务器上面跑的程序很多,又不能直接把环境变量改了,所以只能想着怎么把这个出问题的工程服务指定j ...
- canvas一周一练 -- canvas基础学习
从上个星期开始,耳朵就一直在生病,里面长了个疙瘩,肿的一碰就疼,不能吃饭不能嗨 (┳_┳)……在此提醒各位小伙伴,最近天气炎热,一定要注意防暑上火,病来如山倒呀~ 接下来我正在喝着5块一颗的药学习ca ...