Codeforces--630B--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
- 1000 1000000
- 1011.060722383550382782399454922040
Sample Output
Hint
Source
- #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(快速幂)的更多相关文章
- 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 ...
- codeforces magic five --快速幂模
题目链接:http://codeforces.com/contest/327/problem/C 首先先算出一个周期里面的值,保存在ans里面,就是平常的快速幂模m做法. 然后要计算一个公式,比如有k ...
- CodeForces - 691E Xor-sequences 【矩阵快速幂】
题目链接 http://codeforces.com/problemset/problem/691/E 题意 给出一个长度为n的序列,从其中选择k个数 组成长度为k的序列,因为(k 有可能 > ...
- Codeforces 963 A. Alternating Sum(快速幂,逆元)
Codeforces 963 A. Alternating Sum 题目大意:给出一组长度为n+1且元素为1或者-1的数组S(0~n),数组每k个元素为一周期,保证n+1可以被k整除.给a和b,求对1 ...
- Codeforces 691E题解 DP+矩阵快速幂
题面 传送门:http://codeforces.com/problemset/problem/691/E E. Xor-sequences time limit per test3 seconds ...
- 【codeforces 623E】dp+FFT+快速幂
题目大意:用$[1,2^k-1]$之间的证书构造一个长度为$n$的序列$a_i$,令$b_i=a_1\ or\ a_2\ or\ ...\ or a_i$,问使得b序列严格递增的方案数,答案对$10^ ...
- Codeforces 691E Xor-sequences(矩阵快速幂)
You are given n integers a1, a2, ..., an. A sequence of integers x1, x2, ..., xk is called a & ...
- codeforces 696C C. PLEASE(概率+快速幂)
题目链接: C. PLEASE time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
- Codeforces 954 dijsktra 离散化矩阵快速幂DP 前缀和二分check
A B C D 给你一个联通图 给定S,T 要求你加一条边使得ST的最短距离不会减少 问你有多少种方法 因为N<=1000 所以N^2枚举边数 迪杰斯特拉两次 求出Sdis 和 Tdis 如果d ...
随机推荐
- EF code first Acceleration - CodeFirst 加速
EntityFramework Code First 用起来很方便,可是有时感觉卡,就是有点慢.可以采用以下措施来加速一下,原来取出1万条记录并显示在Winform窗体上第一次需要1.9秒的时间,加速 ...
- JS高级——逻辑中断
1.表达式1||表达式2:表达式1为真,返回表达式1:表达式1为假,返回表达式2 2.表达式1&&表达2:表达式1为真,返回表达式2:表达式1为假,返回表达式1
- nc的简单使用
1.传输文件: 目的主机监听 nc -l 监听端口<未使用端口> > 要接收的文件名 nc -l 6666 > filename.tar 源主机发起请求 nc 目的主机ip ...
- 体验SqlServer Express 2014
想使用SQLServer Express记录一些数据,但使用起来并不令人愉快.SQLServer Express是一个免费的可用数据库,但似乎设置了一些门槛,多少显得并不真心实意.抛开版本(技术)限制 ...
- R语言图表
条形图 在R语言中创建条形图的基本语法是 barplot(H, xlab, ylab, main, names.arg, col) H是包含在条形图中使用的数值的向量或矩阵 xlab是x轴的标签 yl ...
- Redis 之仿微博demo
一.用户注册登录 include './header.php'; include './function.php'; $username = p('username'); $password = p( ...
- mysql高可用架构mha之master_ip_failover脚本
脚本如下: #!/usr/bin/env perl use strict; use warnings FATAL => 'all'; use Getopt::Long; my ...
- 如何从源码启动和编译IoTSharp
IoTSharp 项目是一个开源物联网平台,数据库使用PostgreSQL , 后端使用 Asp.Net Core 2.2 ,前端使用 vue-element-admin , 下面我们介绍如何启动项 ...
- STL源码分析之内存池
前言 上一节只分析了第二级配置器是由多个链表来存放相同内存大小, 当没有空间的时候就向内存池索取就行了, 却没有具体分析内存池是怎么保存空间的, 是不是内存池真的有用不完的内存, 本节我们就具体来分析 ...
- GlobalSign 域名型 SSL 证书
GlobalSign 域名型 SSL 证书,支持通配符型,只验证域名所有权,属于DV 域名验证级SSL证书,无须递交书面审查资料,网上申请便捷有效率.提供40位/56位/128位,最高256位自适 ...