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 ...
随机推荐
- [Git] git merge之squash
reference : https://www.cnblogs.com/ungshow/p/3515161.html 看CM源码时,发现历史记录里有很多squash,于是google了解了一下. Gi ...
- 启动Memcached报错:/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory
1.查找文件放在哪里 sudo find / -name libevent-2.1.so.6 发现放在/usr/local/lib/libevent-2.1.so.6下. 2.创建软链接 sudo l ...
- Adhoc
没觉得Adhoc还有什么做的,这几年貌似很冷了,从通信的角度讲,实现比较困难,实际意义不大,国内最近又跟风了VANET.以我同学做的为例,他考虑用Adhoc做野外分散点的自组网(一个集体内),但从通信 ...
- csv2txt.cpp
#include <iostream> #include <fstream.h> #include <windows.h> #include <iomanip ...
- WebService—CXF整合Spring实现接口发布和调用过程
一.CXF整合Spring实现接口发布 发布过程如下: 1.引入jar包(基于maven管理) <!-- cxf --> <dependency> <groupId> ...
- 500 OOPS: vsftpd: cannot locate user specified in 'chown_username':whoever
错误:500 OOPS: vsftpd: cannot locate user specified in 'chown_username':whoever解决方案:在vsftpd.conf中修改如下两 ...
- 【六】注入框架RoboGuice使用:(Singletons And ContextSingletons)
上一篇我们简单的介绍了一下RoboGuice的使用([五]注入框架RoboGuice使用:(Your First POJO Injection)),今天我们来看下单例以及上下文单例(ContextSi ...
- ubuntu下mongodb启动脚本
run-mongodb.sh #!/bin/bash mongod --dbpath /usr/local/mongodb/data1 --logpath /usr/local/mongodb/log ...
- go语言基础之数组做函数参数是值拷贝
1.数组做函数参数是值拷贝 示例: package main //必须有个main包 import "fmt" //数组做函数参数,它是值传递 //实参数组的每个元素给形参数组拷贝 ...
- Java 线程内异常处理
Thread的run方法是不抛出任何检查型异常(checked exception)的,但是它自身却可能因为一个异常而被终止,导致这个线程的终结.最麻烦的是,在线程中抛出的异常即使使用try...ca ...