hdu1032】的更多相关文章

题目链接:https://cn.vjudge.net/problem/HDU-1032 水题 代码 #include <cstdio> #include <algorithm> using namespace std; const int MAX=8388608; int num[MAX], a, b; int solve(int n){ if (n<MAX && num[n]) return num[n]; if (n==1) return 1; if (n…
题意: 给你一个数n,表示有n辆火车,编号从1到n,入站,问你有多少种出站的可能.    (题于文末) 知识点: ps:百度百科的卡特兰数讲的不错,注意看其参考的博客. 卡特兰数(Catalan):前几项为 : 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670- 令h(0)=1,h(1)=1,catalan数满足递推式:      h(n)= h(0…
Wolf and Rabbit Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7646    Accepted Submission(s): 3844 Problem Description There is a hill with n holes around. The holes are signed from 0 to n-1.A…
#include <iostream> using namespace std; int main() { int a,b,t,i,max; while(cin >> a >> b) { cout << a << " " << b << " "; if(a>b)//大小不确定 { t = a; a = b; b = t; } max = 0; for(i = a; i<=…
POJ题目分类 | POJ题目分类 | HDU题目分类 | ZOJ题目分类 | SOJ题目分类 | HOJ题目分类 | FOJ题目分类 | 模拟题: POJ1006 POJ1008 POJ1013 POJ1016 POJ1017 POJ1169 POJ1298 POJ1326 POJ1350 POJ1363 POJ1676 POJ1786 POJ1791 POJ1835 POJ1970 POJ2317 POJ2325 POJ2390 POJ1012 POJ1082 POJ1099 POJ1114…