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 ...
随机推荐
- HostMonitor监控主机状态
HostMonitor 可以对windows和linux下的主机进行很多信息的监控,还提供web方式查看
- [转载] java的书
1. Java 语言基础 谈到Java 语言基础学习的书籍,大家肯定会推荐Bruce Eckel 的<Thinking in Java >.它是一本写的相当深刻的技术书籍,Java 语言基 ...
- C++获得本机所有网卡的IP和MAC地址信息
一台机器上可能不只有一个网卡,但每一个网卡只有一个MAC地址,而每一个网卡可能配置有多个IP地址:如平常的笔记本电脑中,就会有无线网卡和有线网卡(网线接口)两种:因此,如果要获得本机所有网卡的IP和M ...
- [leetcode]Convert Sorted List to Binary Search Tree @ Python
原题地址:http://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/ 题意:将一条排序好的链表转换为二叉查找树 ...
- Spark性能优化:数据倾斜调优
前言 继<Spark性能优化:开发调优篇>和<Spark性能优化:资源调优篇>讲解了每个Spark开发人员都必须熟知的开发调优与资源调优之后,本文作为<Spark性能优化 ...
- 体绘制(Volume Rendering)概述之4:光线投射算法(Ray Casting)实现流程和代码(基于CPU的实现)
转自:http://blog.csdn.net/liu_lin_xm/article/details/4850630 摘抄“GPU Programming And Cg Language Primer ...
- Linux:su和su-的区别
大部分Linux发行版的默认账户是普通用户,而更改系统文件或者执行某些命令,需要root身份才能进行,这就需要从当前用户切换到root用户.Linux中切换用户的命令是su或su -. 如上图所示,一 ...
- linux time 命令详解
用途说明time命令常用于测量一个命令的运行时间,注意不是用来显示和修改系统时间的(这是date命令干的事情).但是今天我通过查看time命令的手册页,发现它能做的不仅仅是测量运行时间,还可以测量内存 ...
- Android面试总结经
自上周怒辞职以后,就開始苦逼的各种面试生涯,生活全然靠私活来接济,时有时没有,真难.还能快乐的玩耍吗.最多一天面试了5家,哎感觉都是不急招人,各种等待通知.好不easy等来一家.还克扣了薪资,从我要的 ...
- Windows Server 2012 R2 或 2016 无法安装 .Net 3.5.1
Windows Server 2012 R2 或 2016 无法安装 .Net 3.5.1 问题描述 使用 Windows Server 2012 R2 或 Windows Server 2016系统 ...