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 第八章笔记
第八章总结 8.5. heapq - 堆队列算法 有8个算法 方法 heappush heappop heappushpop heapreplace heapify merge nlargest ns ...
- webpack vue 配置
vue-loader 1.)首先创建项目目录 --vue-loader文件夹 |-index.html 入口文件 |-main.js 入口文件 |-App.vue Vue文件 |-package.js ...
- JAVAEE学习路线分享
今天把我的教学经验分享给大家.适合大多数人的学习路线.注:目前作者已经转行做java培训. 首先是培养兴趣.先开始学习HTML知识.也就是做网页,从这里开始比较简单,就是几个标签单词需要记住. 接着开 ...
- 如何退出 Vim
点击 Esc 键,; Vim 进入命令模式.然后输入: :q 退出(这是 :quit 的缩写) :q! 不保存退出(这是 :quit! 的缩写) :wq 写入文件并退出:(这是 :writequi ...
- 日常API之百度翻译
百度翻译是什么,可以吃吗?相信很多人都熟悉,它是我们生活中必不可少的一只东东. 但是,百度翻译开发平台只有每月只能翻译200万个字符,多出的要按照49.00/百万字符来算.对于我酱紫的乞丐程序员来说, ...
- HybridApp Exception
HybridApp Exception [创建安卓虚拟机失败]CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1) ...
- docker中执行sed: can't move '/etc/resolv.conf73UqmG' to '/etc/resolv.conf': Device or resource busy错误的处理原因及方式
错误现象 在docker容器中想要修改/etc/resolv.conf中的namesever,使用sed命令进行执行时遇到错误: / # sed -i 's/192.168.1.1/192.168.1 ...
- php 时间戳转化成天数 四舍五入 整数
public function edit() { global $_W; global $_GPC; $openid=$_W['openid']; $boards = pdo_fetchall('se ...
- win7-x64安装mysql5.7.11(官方zip版)
1.下载官方安装包(http://www.mysql.com/downloads/),此zip包是没有安装器的(*.msi),也没有辅助配置的自动程序. 2.解压zip包,将文件放入指定目录,如:D: ...
- Unity3D-Shader-人物残影效果
[旧博客转移 - 2016年1月7日 00:24 ] 前面的话 上一篇讲了一下人物边缘发光效果,链接: Unity-ShaderLab-实现X光效果,这次我们利用这个Shader来实现人物残影效果 先 ...