Eddy's research II

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2706    Accepted Submission(s): 985

Problem Description
As
is known, Ackermann function plays an important role in the sphere of
theoretical computer science. However, in the other hand, the dramatic
fast increasing pace of the function caused the value of Ackermann
function hard to calcuate.

Ackermann function can be defined recursively as follows:

Now
Eddy Gives you two numbers: m and n, your task is to compute the value
of A(m,n) .This is so easy problem,If you slove this problem,you will
receive a prize(Eddy will invite you to hdu restaurant to have supper).

 
Input
Each line of the input will have two integers, namely m, n, where 0 < m < =3.
Note that when m<3, n can be any integer less than 1000000, while m=3, the value of n is restricted within 24.
Input is terminated by end of file.
 
Output
For each value of m,n, print out the value of A(m,n).
 
Sample Input
1 3
2 4
 
Sample Output
5
11
代码:
 /*@coder龚细军*/
#include<stdio.h>
int Ackermann(int m,int n)
{
if(m==) return n+;
else if(m==) return n+;
else if(m==) return *n+;
else if(m==) return (<<n+)-;
}
int main()
{
int n,m;
while(~scanf("%d%d",&m,&n))
{
printf("%d\n",Ackermann(m,n));
}
return ;
}

HDUOJ----1165Eddy's research II的更多相关文章

  1. HDU 1165 Eddy's research II(给出递归公式,然后找规律)

    - Eddy's research II Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64 ...

  2. HDU 1165 Eddy's research II (找规律)

    题意:给定一个表达式,然后让你求表达式的值. 析:多写几个就会发现规律. 代码如下: #pragma comment(linker, "/STACK:1024000000,102400000 ...

  3. HDU 1165 Eddy's research II

    题意:已知,求A(m, n). 分析:根据样例模拟一下过程就可以找出递推关系. #include<cstdio> #include<cstring> #include<c ...

  4. 动态规划入门——Eddy's research II

    转载请注明出处:http://blog.csdn.net/a1dark 分析:找规律 #include<stdio.h> int main(){ int m,n; while(scanf( ...

  5. HDU1165: Eddy's research II(递推)

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=1165 果断不擅长找规律啊,做这种题静不下心来. Ackermann function can be def ...

  6. HDU-1165-Eddy&#39;s research II

    这个事实上是一个递归题.题目非常easy.m的数非常小.分三种情况.算一下.就能够直接把公式算出来. 当然,也能够用dp做: #include<iostream> #include< ...

  7. hdu 1165 Eddy&#39;s research II(数学题,递推)

    // Eddy 继续 Problem Description As is known, Ackermann function plays an important role in the sphere ...

  8. Eddy's problem partI

    Eddy's mistakes[HDU1161] Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java ...

  9. HDU 1165 公式推导题

    题目链接: acm.hdu.edu.cn/showproblem.php?pid=1165 Eddy's research II Time Limit: 4000/2000 MS (Java/Othe ...

随机推荐

  1. Android NDK开发篇(五):Java与原生代码通信(数据操作)

    尽管说使用NDK能够提高Android程序的运行效率,可是调用起来还是略微有点麻烦.NDK能够直接使用Java的原生数据类型,而引用类型,由于Java的引用类型的实如今NDK被屏蔽了,所以在NDK使用 ...

  2. NLP十大里程碑

    NLP十大里程碑 2.1 里程碑一:1985复杂特征集 复杂特征集(complex feature set)又叫做多重属性(multiple features)描写.语言学里,这种描写方法最早出现在语 ...

  3. 数学图形之Kuen Surface

    Kuen Surface应该又是一个以数学家名字命名的曲面.本文将展示几种Kuen Surface的生成算法和切图,其中有的是标准的,有的只是相似.使用自己定义语法的脚本代码生成数学图形.相关软件参见 ...

  4. 第十一章 springboot + mongodb(简单查询)

    1.mongodb在mac上的安装 下载mongodb,https://www.mongodb.org/ 解压缩到一个指定文件夹,如:/Users/enniu1/Desktop/zjg/mongodb ...

  5. 泛型 Generic 类型擦除引起的问题及解决方法

    参考:http://blog.csdn.net/lonelyroamer/article/details/7868820#comments 因为种种原因,Java不能实现真正的泛型,只能使用类型擦除来 ...

  6. idea 创建 简单的scala maven项目

    1.创建maven scala项目 2.maven配置 <properties> <scala.version>2.11.8</scala.version> < ...

  7. Android -- 获取IP和MAC地址

    通过InetAddress.getLocalHost()得到始终是“127.0.0.1”,要想得到真正的网络ip地址要通过下面的方法: 首先新建一个工程,修改AndroidManifest.xml文件 ...

  8. [置顶] Spring中自定义属性编辑器

    Spring中的属性编辑器能够自动的将String类型转化成需要的类型,例如一个类里面的一个整型属性,在配置文件中我们是通过String类型的数字进行配置的,这个过程中就需要一个转化操作,当然这个转化 ...

  9. Win10系统下面的TR1008解决方案

    最近为了体验高大上的Win10系统,于是就把本本原来的Win7旗舰版 升级 到了Win10专业版.之后又在本本上部署了cognos,但是在打开Transform导入IQD数据源的时候就报错了,错误和之 ...

  10. 【pyhon】理想论坛爬虫1.07 退出问题,乱码问题至此解决,只是目前速度上还是遗憾点

    在 https://www.cnblogs.com/mengyu/p/6759671.html 的启示下,解决了乱码问题,在此向作者表示感谢. 至此,困扰我几天的乱码问题和退出问题都解决了,只是处理速 ...