hdoj 2085 核反应堆【水】
核反应堆
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 12149 Accepted Submission(s):
5517
高能质点碰击核子时,质点被吸收,放出3个高能质点和1个低能质点;
低能质点碰击核子时,质点被吸收,放出2个高能质点和1个低能质点。
假定开始的时候(0微秒)只有一个高能质点射入核反应堆,每一微秒引起一个事件发生(对于一个事件,当前存在的所有质点都会撞击核子),试确定n微秒时高能质点和低能质点的数目。
可以使用long long int对付GNU C++,使用__int64对付VC6
#include<stdio.h>
#include<string.h>
//#define LL long long
#define MAX 35
__int64 high[MAX],low[MAX];
int n;
int main()
{
int i,j;
low[0]=0;
high[0]=1;
for(i=1;i<MAX;i++)
{
high[i]=high[i-1]*3+low[i-1]*2;
low[i]=low[i-1]+high[i-1];
}
while(scanf("%d",&n)&&n!=-1)
{
printf("%I64d, %I64d\n",high[n],low[n]);
}
return 0;
}
hdoj 2085 核反应堆【水】的更多相关文章
- HDU 2085 核反应堆 --- 简单递推
HDU 2085 核反应堆 /* HDU 2085 核反应堆 --- 简单递推 */ #include <cstdio> ; long long a[N], b[N]; //a表示高能质点 ...
- hdu 2085 核反应堆
看完题,想到用结构体存储高质点和低质点,然后打表存储<33的质点数量. #include<stdio.h> struct hilo { long long hi,lo; }; int ...
- HDOJ 1070 Milk(水题,考英文的)
Problem Description Ignatius drinks milk everyday, now he is in the supermarket and he wants to choo ...
- HDOJ 5387 Clock 水+模拟
Clock Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Subm ...
- 杭电oj2064、2067、2068、2073、2076-2078、2080、2083-2085
2064 汉诺塔III #include<stdio.h> int main(){ int n,i; _int64 s[]; while(~scanf("%d",&a ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- 水题 HDOJ 4727 The Number Off of FFF
题目传送门 /* 水题:判断前后的差值是否为1,b[i]记录差值,若没有找到,则是第一个出错 */ #include <cstdio> #include <iostream> ...
- 水题 HDOJ 4716 A Computer Graphics Problem
题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...
- HDOJ/HDU 1328 IBM Minus One(水题一个,试试手)
Problem Description You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or ...
随机推荐
- 欢迎使用 Markdown 编辑器写博客
本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和图片上传 LaTex数学公式 UML ...
- ITEXTSHARP学习整理
学习的版本iTextSharp.5.5.5. 关于获取PDF中的图片资源 /// <summary> /// 将PDF中的图片资源转换成二进制 /// </summary> / ...
- SGU 106.Index of super-prime
时间限制:0.25s 空间限制:4M 题目大意: 在从下标1开始素数表里,下标为素数的素数,称为超级素数(Super-prime),给出一个n(n<=10000) ...
- SGU 231.Prime Sum
题意: 求有多少对质数(a,b)满足a<=b 且a+b也为质数.(a+b<=10^6) Solution: 除了2之外的质数都是奇数,两个奇数的和是偶数,不可能是质数.所以题目就是求差为2 ...
- 【转载】C++应用引用计数技术
原帖:http://www.cnblogs.com/chain2012/archive/2010/11/12/1875578.html 因为Windows的内核对象也运用了引用计数,所以稍作了解并非无 ...
- paramiko SSH 模块简单应用。
目的:需要ssh链接到Linux主机,执行telnet 命令,抓回显匹配制定内容. ssh --->执行telnet到本地端口--->执行类似 ls 的命令.匹配命令执行后的特定回显字段. ...
- sql查询一个班级中总共有多少人以及男女分别多少人
--创建视图 create view StuClassView as SELECT s.ID ,s.StuName ,s.StuAge ,s.StuAddress ,s.StuTel ,s.Class ...
- Python Tutorial 学习(七)--Input and Output
7. Input and Output Python里面有多种方式展示程序的输出.或是用便于人阅读的方式打印出来,或是存储到文件中以便将来使用.... 本章将对这些方法予以讨论. 两种将其他类型的值转 ...
- android开发学习笔记:圆角的Button
转自:http://www.cnblogs.com/gzggyy/archive/2013/05/17/3083218.html 在res目录下的drawable-mdpi建立xml文件shape.x ...
- Whitespace character
In computer science, whitespace is any character or series of whitespace characters that represent h ...