HDU_6033_Add More Zero
Add More Zero
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 2042 Accepted Submission(s): 1278
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.
64
Case #2: 19
- 对于2^m-1>=10^k
- 解得k<=lb(2^m-1)/lb(10)
- 即k<=m/lb(10)
#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <climits>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
typedef long long LL ;
typedef unsigned long long ULL ;
const int maxn = 1e5 + ;
const int inf = 0x3f3f3f3f ;
const int npos = - ;
const int mod = 1e9 + ;
const int mxx = + ;
const double eps = 1e- ;
const double PI = acos(-1.0) ; int main(){
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
int T=;
double m;
while(~scanf("%lf",&m)){
printf("Case #%d: %d\n",++T,(int)(m/log2((double))));
}
return ;
}
HDU_6033_Add More Zero的更多相关文章
随机推荐
- 【Postgres】dump数据库备份与还原
备份 pg_dump.exe -h localhost -p 5432 -U postgres -F plain -v -f C:\Backup.sql db1 2> C:\Backup.log ...
- C语言编程规范—命名规则
C是一门朴素的语言,你使用的命名也应该这样.与Modula-2和Pascal程序员不同,C程序员不使用诸如“ThisVariableIsATemporaryCounter”这样“聪明”的名字.C程序员 ...
- weblogic创建域生产模式,输入用户名闪退
weblogic创建域,生产模式,报错 <2017-12-29 下午04时53分59秒 CST> <Info> <Security> <BEA-090065& ...
- mysql5.7 服务无法启动的问题解决方法
解决办法: 1.把MySQL文件低下的data文件删掉,如果没有的话,就不用管了: 2.在mysql安装路径下,执行mysqld --initialize命令进行初始化,mysql会自动帮你重新创建d ...
- iOS开发-- 如何让 UITableView 的 headerView跟随 cell一起滚动
在我们利用 UITableView 展示我们的内容的时候,我需要在顶部放一个不同于一般的cell的 界面,这个界面比较独特. 1. 所以我就把它 作为一个section的 headerView. 也就 ...
- Splash autoload() 方法
autoload() 方法可以设置每个页面访问时自动加载的对象,比如自动加载 JavaScript 代码,自动加载 Ajax 代码等等 注意此方法只负责加载 JavaScript/Ajax 代码,不执 ...
- The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make s
我出现这个问题是引用资源文件问题 helper.getView(R.id.in_pic).setBackgroundResource(item.getResourceId()); //错的helper ...
- Servlet基本用法(二)接口和类
一.摘要 本文主要简单介绍开发Servlet需要用到的接口和类. 二.ServletRequest和ServletResponse接口 当客户请求到来时,由容器创建一个ServletRequest对象 ...
- Firefox --- 火狐浏览器下载
http://www.firefox.com.cn/download/
- 题目1208:10进制 VS 2进制(进制转换以及大数保存问题)
题目链接:http://ac.jobdu.com/problem.php?pid=1208 详细链接:https://github.com/zpfbuaa/JobduInCPlusPlus 参考代码: ...