The city administration of IT City decided to fix up a symbol of scientific and technical progress in the city's main square, namely an indicator board that shows the effect of Moore's law in real time.
Moore's law is the observation that the number of transistors in a dense integrated circuit doubles approximately every 24 months. The implication of Moore's law is that computer performance as function of time increases exponentially as well.
You are to prepare information that will change every second to display on the indicator board. Let's assume that every second the number of transistors increases exactly 1.000000011 times.
InputThe only line of the input contains a pair of integers n (1000 ≤ n ≤ 10 000) and t (0 ≤ t ≤ 2 000 000 000) — the number of transistors in the initial time and the number of seconds passed since the initial time.
Output one number — the estimate of the number of transistors in a dence integrated circuit in t seconds since the initial time. The relative error of your answer should not be greater than 10 - 6.
1000 1000000
1011.060722383550382782399454922040
n每秒钟变大1.000000011 倍,问m秒之后变为多大,很明显,快速幂
#include<cstdio> #include<algorithm> using namespace std; #define P 1.000000011 double p(double n,int m) { double a=1; while(m) { if(m%2==1) a=a*n; m=m/2; n=n*n; } return a; } int main() { int n;int m; while(~scanf("%d%d",&n,&m)){ printf("%.8f\n",n*p(P,m)); } return 0; }

IT城市决定在主广场上安装一个实时显示摩尔定律效果的指示牌。摩尔定律指出,密集集成电路中的晶体管数量大约每24个月翻一番,意味着计算机性能随时间呈指数级增长。本篇介绍如何通过每秒更新的数值来估算经过特定秒数后的晶体管数量。
544

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



