Description
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.
Input
The 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
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.
Sample Input
1000 1000000
1011.060722383550382782399454922040
题目:给出你n,m两个数,求出n乘以1.000000011的m次方
快速幂:
#include<stdio.h> #include<iostream> #include<string.h> #include<algorithm> using namespace std; int main() { double n,m,T1,T2; while(scanf("%lf%lf",&n,&m)!=EOF) { double s=1; T1=n,T2=m; for(int j=1;j<=1000;j++) { s*=1.000000011; } double temp=m; for(int i=1;i<=m;i++) { if(temp/1000>=1) { temp-=1000; n*=s; m=temp; i=1; } else n*=1.000000011; } printf("%.7lf\n",n); } }