HDU 1165 Eddy's research II (推公式)
2014-08-07 00:01
531 查看
Eddy's research II
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3122 Accepted Submission(s): 1137
[align=left]Problem Description[/align]
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:
#include<cstdio> #include<cstring> #include<stdlib.h> #include<algorithm> using namespace std; __int64 A(int m,int n) { if(m==0) return n+1; if(m==1) return n+2; if(m==2) return 2*n+3; if(m==3) return (1<<(n+3))-3; } int main() { int m,n; while(scanf("%d %d",&m,&n)!=EOF) { printf("%I64d\n",A(m,n)); } return 0; }
View Code
相关文章推荐
- hdu 1165 Eddy's research II (DP)
- HDU - 1165 - Eddy's research II
- hdu 1165 Eddy's research II
- hdu 1165 Eddy's research II(数学:等差 等比公式)
- hdu 1165 Eddy's research II
- hdu 1165 Eddy's research II (找规律)
- HDU 1165 Eddy's research II (找规律)
- HDU 1165 Eddy's research II (数学推导)
- HDU-1165-Eddy's research II(递推 打表 找规律)
- HDU 1165 Eddy's research II
- HDU 1165 Eddy's research II 打表找规律
- hdu-1165-Eddy's research II
- hdu 1165 Eddy's research II
- HDU-1165-Eddy's research II
- hdu 1165 Eddy's research II
- hdu 1165 Eddy's research II(数学题,递推)
- HDU:1165 Eddy's research II
- hdu 1165 Eddy's research II(数学题,递推)
- HDU 1165 Eddy's research II(递推)
- HDU 1165 Eddy's research II(递推)