hdoj1028
来源:互联网 发布:广东中标数据科技 编辑:程序博客网 时间:2024/05/20 15:37
题目大意:
看例子就知道题意了,算法书上的原题
解题思路:
基础动态规划
代码如下:
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>int main(){ int i, j, a; int n[130][130]; for(i=0; i<130; i++) n[i][1] = n[1][i] = 1; for(i=2; i<130; i++) { for(j=2; j<130; j++) { if(i>j) n[i][j] = n[i][j-1] + n[i-j][j]; else if(i==j) n[i][j] = 1 + n[i][j-1]; else n[i][j] = n[i][i]; } } while(scanf("%d",&a)!=EOF) { printf("%d\n",n[a][a]); } return 0;}
0 0
- hdoj1028
- hdoj1028
- hdoj1028
- hdoj1028;他们说这题叫dp...
- HDOJ1028解题报告
- HDOJ1028 Ignatius and the Princess III
- HDOJ1028(正整数拆分-普通型母函数模板)
- 母函数之Ignatius and the Princess III hdoj1028
- hdoj1028 Ignatius and the Princess III(整数分解)
- hdoj1028 Ignatius and the Princess III (母函数-整数拆分)
- hdoj1028 Ignatius and the Princess III(母函数,生成函数)
- 数据结构3----线性表中链式结构的其他几种实现(霜之小刀)
- 并查集
- C# 坐标变换::
- Js数组的基本方法1
- 第十五章 String类
- hdoj1028
- 2、SQL Server:SQL利用Case When Then多条件判断SQL 语句
- Ubuntu14.04lts wifi连接不稳定问题
- POJ 3693 Maximum repetition substring (后缀数组+RMQ 求重复最多的连续子串)
- 机器视觉之镜头景深概念与计算
- 链表:自引用结构
- 面试题4
- Service(远程服务)
- Glide-入门教程