Add More Zero
来源:互联网 发布:博罗县网络问政 编辑:程序博客网 时间:2024/06/07 12:50
题目链接
Add More Zero
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0
Problem 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 0 denotes the answer of corresponding case.
Nowadays, he is preparing a thought-provoking problem on a specific type of supercomputer which has ability to support calculations of integers between 0 denotes the answer of corresponding case.
Sample Input
164
Sample Output
Case #1: 0Case #2: 19
思路:
题目是求[0,2^m-1]上的十进制数最大有多少位,即10^k中k的最大值。
显然k=log10(2^m-1),要是2^m就好了,我们算的是位数,如果+1影响到它的位数,说明2^m-1末位是9,显然不可能,则k=log10(2^m)=m*log10(2)。
ac代码:
#include<stdio.h>#include<math.h>int m;int main(){ int ans; int cas=0; while(~scanf("%d",&m)) { ans= log10(2)*m; printf("Case #%d: %d\n",++cas,ans); } return 0;}
阅读全文
0 0
- Add More Zero
- Add More Zero
- 1001.Add More Zero
- hdu6033--Add More Zero
- HDU6033-Add More Zero
- HDU6033-Add More Zero
- hdu6033 Add More Zero
- Add More Zero HDU
- Add More Zero
- HDU-Add More Zero
- Add More Zero
- Add More Zero
- 6033 Add More Zero
- Add More Zero
- Add More Zero HDU
- 杭电 Add More Zero
- HDU-6033 Add More Zero
- HDU 6033 Add More Zero
- 单例模式
- 仿淘宝滚动新闻
- 关于国外kvm架构vps提速
- MyBatis 框架基础入门
- javascript知识点
- Add More Zero
- 设计模式之单例模式
- MQTT协议笔记之头部信息
- Vue 过滤器(Filter)
- nyoj国王的魔镜
- Linux 安装 mysql5.7.7-64位
- Move-ADObject : 由于对象的父类不是未范例化就是被删除了,所以不能执行操作。
- 乔姑娘
- PTA甲 1105. Spiral Matrix (25)