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 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 1 to 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.
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 1 to 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.
1 64
Case #1: 0 Case #2: 19
#include <cstdio> #include <cmath> int main() { int n, Case = 1; while (~scanf("%d",&n)) { double ans = n * log10(2); printf("Case #%d: %d\n",Case ++ , (int)ans); } }
本文介绍了一种通过计算确定特定超级计算机能处理的最大整数范围的方法。超级计算机能处理0到2^m-1之间的整数,而目标整数范围为1到10^k。文章提供了一个算法示例,通过输入正整数m,输出对应的k值。
2108

被折叠的 条评论
为什么被折叠?



