HDUOJ----1165Eddy's research II
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
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).
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.
/*@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的更多相关文章
- HDU 1165 Eddy's research II(给出递归公式,然后找规律)
- Eddy's research II Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64 ...
- HDU 1165 Eddy's research II (找规律)
题意:给定一个表达式,然后让你求表达式的值. 析:多写几个就会发现规律. 代码如下: #pragma comment(linker, "/STACK:1024000000,102400000 ...
- HDU 1165 Eddy's research II
题意:已知,求A(m, n). 分析:根据样例模拟一下过程就可以找出递推关系. #include<cstdio> #include<cstring> #include<c ...
- 动态规划入门——Eddy's research II
转载请注明出处:http://blog.csdn.net/a1dark 分析:找规律 #include<stdio.h> int main(){ int m,n; while(scanf( ...
- HDU1165: Eddy's research II(递推)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1165 果断不擅长找规律啊,做这种题静不下心来. Ackermann function can be def ...
- HDU-1165-Eddy's research II
这个事实上是一个递归题.题目非常easy.m的数非常小.分三种情况.算一下.就能够直接把公式算出来. 当然,也能够用dp做: #include<iostream> #include< ...
- hdu 1165 Eddy's research II(数学题,递推)
// Eddy 继续 Problem Description As is known, Ackermann function plays an important role in the sphere ...
- Eddy's problem partI
Eddy's mistakes[HDU1161] Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
- HDU 1165 公式推导题
题目链接: acm.hdu.edu.cn/showproblem.php?pid=1165 Eddy's research II Time Limit: 4000/2000 MS (Java/Othe ...
随机推荐
- scala编程第17章学习笔记(1)——集合类型
列表 列表的初始化及对其首尾的访问: scala> val colors = List("red", "blue", "green") ...
- OpenCV学习(16) 细化算法(4)
本章我们学习Rosenfeld细化算法,参考资料:http://yunpan.cn/QGRjHbkLBzCrn 在开始学习算法之前,我们先看下连通分量,以及4连通性,8连通性的概念: http://w ...
- TCP三次握手四次挥手相关问题探讨
TCP的握手挥手和状态转换是很多网络问题的基础.在此进行相关问题的讨论及记录. 首先,这幅图大致介绍了TCP连接和断开的过程: 注意其中的几个状态: LISTEN, SYN-SEND, SYN-RCV ...
- iOS开发--开源库
图像: 1.图片浏览控件MWPhotoBrowser 实现了一个照片浏览器类似 iOS 自带的相册应用,可显示来自手机的图片或者是网络图片,可自动从网络下载图片并进行缓存.可对图片进行缩 ...
- JSON学习资料整理
1.什么是JSON JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式.它基于JavaScript的一个子集. JSON采用完全独立于语言的文本格式,但是也使 ...
- vue-router路由知识补充
1.render函数 var app = new Vue({ el: '#app', router, render: h => h(App) //新添加的函数操作 }) 我们新加了render: ...
- 【RPC】Thrift ICE 等 RPC 框架相关资料
RPC框架-Thrift-ICE Apache Thrift - Documentation Apache Thrift - Index of tutorial/ Apache Thrift - Ab ...
- Visual Tree
1.GetVisualParent public static T GetVisualParent<T>(DependencyObject obj) where T : Dependenc ...
- xshell实现端口转发
跳板机:10.127.10.1 目标机:10.127.4.25:8080 目的:出于安全,本地电脑是与远程服务器是网关不通的,为了能访问远程服务器数据必须做端口转发 SSH连接与身份认证为跳板机账号密 ...
- Mongo读书笔记1 -- GridFS
一个Mongo文档最大4M. GridFS不依赖于MongoDB, 其他符合规范的驱动都可以访问它. GridFS包含两部分:一部分存储文件名和其他metadata; 另一部分存储实际的文件,通常 ...