Codeforces 630 B. Moore's Law
2016-04-09 20:19
375 查看
B. Moore's Law
time limit per test
0.5 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
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.
Examples
input
output
time limit per test
0.5 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
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.
Examples
input
1000 1000000
output
1011.060722383550382782399454922040
#include <iostream> #include<cstdio> #include<cstring> #include<cmath> #include<vector> using namespace std; __int64 rec[32]={0}; int main() { int t; __int64 n,sum; for(int i=0;i<32;++i) rec[i]=pow(2,i); scanf("%d",&t); while(t--) { int i; sum=0; scanf("%I64d",&n); for(i=0;i<32;++i) { if(n<rec[i]) break; sum+=rec[i]; } sum=n*(n+1)/2-2*sum; printf("%I64d\n",sum); } return 0; }
相关文章推荐
- 第8课 函数重载分析(上)
- 第二章 IPC机制
- 子类的继承性
- uva816
- FreeBSD与Linux的比较
- Java中的static
- NYOJ 116 士兵杀敌(二)
- ORACLE新建用户及建表
- Codeforce 630B Moore's Law
- POJ 2385 Apple Catching(DP)
- 聚焦数据可视化之中的一个--沃尔马怎样利用数据可视化依据实时社交数据调整採购和仓储计划?
- 使用命令提示符/cmd开启笔记本wifi
- C#基础之数据类型Int64
- 第六次作业
- 团队介绍
- mysql修改密码
- Linux下关机命令,shutdown -r now reboot及halt命令的区别
- 算法初探——希尔排序
- Struts2中jsp前台传值到action后台的三种方式
- Java书籍大纲提要之深入Java虚拟机