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的更多相关文章
随机推荐
- MapWinGIS------引发类型为“System.Windows.Forms.AxHost+InvalidActiveXStateException”的异常
转载:http://www.cnblogs.com/dzone/archive/2011/09/08/2171445.html
- Linq与Lambda
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button ...
- Eclipse cdt解决github导入的项目无法打开声明的bug (cannot open declaration)
概述: 我利用eclipse 的git插件clone github上的远程项目(C++)到本地时遇到一个问题:clone下来的项目没有C++特性,无法使用open declaration等操作,下面是 ...
- grid网格的流动定位
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- ISO27001信息安全管理体系
0x00 前言 初入甲方,刚开始接触的应该就是ISO27001信息安全管理体系,你拿到的应该就是一整套安全管理类的文档.在甲方,稍微有点规模的公司很注重制度和流程,岗位职责分工明细,那么这些安全管理制 ...
- WopiServerTutorial
Program.cs using System; using System.Collections.Generic; using System.IO; using System.Linq; using ...
- Python查找文件
1. 利用字符串的前缀和后缀匹配查找文件 str.startswith() star.endswith() 2.使用fnmatch fnmatch 判断文件名是否符合特定模式 ...
- [Ubuntu] apt 添加第三方库
1. 方法一:直接在 /etc/apt/sources.list 添加第三方库. $ sudo vi /etc/apt/sources.list 在其中添加: deb http://archive.s ...
- 微信小程序的wx-charts插件
还有就是可以使用一些小程序的插件,比如wx-charts. 先来看一下网上对这个插件的评价: 目前在github上有1804颗星,使用的比较广泛. github地址:https://github.co ...
- c++学习笔记——个单词转换的map程序详解
实现功能:给定一个string,将它转换为另一个string.程序输入是两个文件,第一个文件保存转换规则,第二个文件为将要进行转换的文本. IDE:Windows7+VS2013 #include & ...