http://codeforces.com/problemset/problem/630/B
题意:
著名的摩尔定律(可以问小度),题目描述为,每一秒钟都会在原来的基础上,集成电路晶体管的增加 1.000000011 倍,
给定原来的数量 n ,问经过 t 秒后晶体管的数量。
思路:
快速幂运算。
AC CODE:
#include<stdio.h>
#include<cstring>
#include<algorithm>
#define AC main()
using namespace std;
const int MYDD = 1103;
double PowQuick(double a, int n) {//快速幂 a^n
double ans = 1;
while(n > 0) {
if(n & 1) ans *= a;// n 为奇数
a = a*a;
n >>= 1;// 除 2
}
return ans;
}
int AC {
int n, t;
scanf("%d %d", &n, &t);
printf("%.8lf\n", n * PowQuick(1.0*1.000000011, t));
return 0;
}