Moore's Law

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

Submit
Status

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

Sample Output

Hint

Source


n每秒钟变大1.000000011 倍,问m秒之后变为多大,很明显,快速幂
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define P 1.000000011
double p(double c,int t)
{
double aa=1;
while(t)
{
if(t&1) aa*=c;
c*=c;
t=t>>1;
}
return aa;
}
int main()
{
int n,m;
while(cin>>n>>m)
{
double ans=p(P,m);
printf("%.8f\n",ans*n);
}
return 0;
}

Codeforces--630B--Moore's Law(快速幂)的更多相关文章

  1. codeforces 630B Moore's Law

    B. Moore's Law time limit per test 0.5 seconds memory limit per test 64 megabytes input standard inp ...

  2. codeforces magic five --快速幂模

    题目链接:http://codeforces.com/contest/327/problem/C 首先先算出一个周期里面的值,保存在ans里面,就是平常的快速幂模m做法. 然后要计算一个公式,比如有k ...

  3. CodeForces - 691E Xor-sequences 【矩阵快速幂】

    题目链接 http://codeforces.com/problemset/problem/691/E 题意 给出一个长度为n的序列,从其中选择k个数 组成长度为k的序列,因为(k 有可能 > ...

  4. Codeforces 963 A. Alternating Sum(快速幂,逆元)

    Codeforces 963 A. Alternating Sum 题目大意:给出一组长度为n+1且元素为1或者-1的数组S(0~n),数组每k个元素为一周期,保证n+1可以被k整除.给a和b,求对1 ...

  5. Codeforces 691E题解 DP+矩阵快速幂

    题面 传送门:http://codeforces.com/problemset/problem/691/E E. Xor-sequences time limit per test3 seconds ...

  6. 【codeforces 623E】dp+FFT+快速幂

    题目大意:用$[1,2^k-1]$之间的证书构造一个长度为$n$的序列$a_i$,令$b_i=a_1\ or\ a_2\ or\ ...\ or a_i$,问使得b序列严格递增的方案数,答案对$10^ ...

  7. Codeforces 691E Xor-sequences(矩阵快速幂)

    You are given n integers a1,  a2,  ...,  an. A sequence of integers x1,  x2,  ...,  xk is called a & ...

  8. codeforces 696C C. PLEASE(概率+快速幂)

    题目链接: C. PLEASE time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  9. Codeforces 954 dijsktra 离散化矩阵快速幂DP 前缀和二分check

    A B C D 给你一个联通图 给定S,T 要求你加一条边使得ST的最短距离不会减少 问你有多少种方法 因为N<=1000 所以N^2枚举边数 迪杰斯特拉两次 求出Sdis 和 Tdis 如果d ...

随机推荐

  1. Codeforces_732D_(二分贪心)

    D. Exams time limit per test 1 second memory limit per test 256 megabytes input standard input outpu ...

  2. 【Centos7】Tomcat安装及一个服务器配置多个Tomcat

    完成解压 参考 http://www.cnblogs.com/h--d/p/5074800.html https://www.cnblogs.com/tudou-22/p/9330875.html 步 ...

  3. PHP 设计模式--基础

    设计模式的宗旨就是:重用. 在面向对象中,类是用于生成对象的代码模版,而设计模式是用于解决共性问题的代码模版. 遵循这样的模板,我们可以设快速地设计出优秀的代码. 注意,设计模式只是模板,不是具体的代 ...

  4. sysbench_fileio.sh

    当我--file-total-size=30G 并且指定3个文件的时候,结果是产生3个10G的文件,然而--max-time=20被忽视了,虽然指定了20s的限制,实际上是在prepare阶段,--m ...

  5. Dijkstra算法求最短路径

    #include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h&g ...

  6. Spring+SpringMVC+MyBatis整合教程

    1.基本概念 1.1.Spring Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One  ...

  7. Java POI Excel 导入导出

    这个东西很容易懂,不是特别难,难就难在一些复杂的计算和Excel格式的调整上. 近期写了一个小列子,放上来便于以后使用. POI.jar下载地址:http://mirror.bit.edu.cn/ap ...

  8. spring配置Converter、Formatter日期转换器

    最近有点恶补spring的嫌疑,然后学了一点知识点纪录在此. 往往在项目中我们会遇到前端页面输入一个日期类型的字符串传递到后端后我们需要去做转换.甚至在传递的过程中就会报错. Spring有一个一劳永 ...

  9. CodeForces - 205B - Little Elephant and Sorting

    先上题目: Little Elephant and Sorting time limit per test 1 second memory limit per test 256 megabytes i ...

  10. VM 与主机不通的解决方法

    [root@localhost network-scripts]# ping 192.168.1.222 PING 192.168.1.222 (192.168.1.222) 56(84) bytes ...