codeforces 630B Moore's Law

Moore's Law
Time Limit:500MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

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

Input
1000 1000000
Output
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);
	}
} 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值