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. SV creation order

    SystemVerilog Instance Worlds When generating an UVM testbench and in particular the DUT - testbench ...

  2. 【MySQL】二进制分发安装

    操作系统:Red Hat Enterprise Linux Server release 6.5 Mysql安装包:mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz ...

  3. jQuery——开关灯

    js对象与jquery对象的相互转化: 1.$(js对象) 2.$(selector).get(索引).$(selector)[索引] <!DOCTYPE html> <html l ...

  4. JAVA趣味逻辑算法

    /**已知4位同学中的一位数学考了100分,当小李询问这4位是谁考了100分时,4个人的回答如下: A说:不是我. B说:是C C说:是D. D说:他胡说. 已知三个人说的是真话,一个人说的是假话.现 ...

  5. 【VHDL】组合逻辑电路和时序逻辑电路的区别

    简单的说,组合电路,没有时钟:时序电路,有时钟. ↓ 也就是说,组合逻辑电路没有记忆功能,而时序电路具有记忆功能. ↓ 在VHDL语言中,不完整条件语句对他们二者的影响分别是什么?组合逻辑中可能生成锁 ...

  6. shell脚本网络流量实时查看

    Linux网络流量实时查看脚本,Centos默认没有自带流量查看工具,通过网上的资料做了一些修改 #!/bin/bash # Author: Ca0gu0 # Script Name: idev.sh ...

  7. Entertainment Box Gym100781E(数据结构+贪心)

    Entertainment Box 题意: 有n个节目,每个节目给出开始时间(st)和结束时间(en): 有k个内存条这k个内存条可以同时存储节目.如果节目j的开始时间stj  大于等于节目i的结束时 ...

  8. cuda npp库旋转图片

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

  9. [LeetCode] 887. Super Egg Drop 超级鸡蛋掉落

    You are given K eggs, and you have access to a building with N floors from 1 to N.  Each egg is iden ...

  10. 优雅的退出/关闭/重启gunicorn进程

    在工作中,会发现gunicorn启动的web服务,无论怎么使用kill -9 进程号都是无法杀死gunicorn,经过我一番百度和谷歌,发现想要删除gunicorn进程其实很简单. 第一步获取Guni ...