OJ题目 :
click here~~
题目分析:给一个数字三角形,从最上面一个数字开始,方向只能往左下或者右下,一直到最后一行,求经过的所有数字和的最大值。
搞清楚在输入的数据中,route的方向就行。
AC_CODE
int num[102][102];
int main(){
int n , i , j , k ;
while(cin >> n){
...
分类:
其他好文 时间:
2014-07-22 23:05:55
阅读次数:
372
题目链接很简单的递推,但是写代码的过程中,犯了一个严重的错误,就是我用unsigned
int型变量>= 0 作为循环条件(而且是降序)的时候,出现了问题。附上代码: 1 class Solution { 2 public: 3 int
minimumTotal(vector > &tria...
分类:
其他好文 时间:
2014-05-06 00:10:57
阅读次数:
335
HDU 3033 I love sneakers! (01背包+反分组背包)...
分类:
其他好文 时间:
2014-05-04 08:51:09
阅读次数:
229
EXOCENTER OF A TRIANGLE
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 3209
Accepted: 1259
Description
Given a triangle ABC, the Extriangles of ABC are cons...
分类:
其他好文 时间:
2014-05-03 21:14:28
阅读次数:
340
Let's consider a triangle of numbers in which a number appears in the first line, two numbers appear in the second line, three in the third line, etc. Develop a program which will compute the largest ...
分类:
其他好文 时间:
2014-05-03 17:32:22
阅读次数:
284
这道题,采用动态规划算法。from top to
down,把到每个节点的最小路径和都求出来。下面是AC代码: 1 /** 2 * Given a triangle, find the minimum path
sum from top to bottom. 3 * Each ...
分类:
其他好文 时间:
2014-05-02 12:19:23
阅读次数:
382
题目链接:11401 - Triangle Counting
题意:有1,2,3....n的边,求最多能组成的三角形个数。
思路:利用三角形不等式,设最大边为x,那么y + z > x 得 x - y
然后y取取值,可以从1取到x - 1,y为n时候,有n - 1个解,那么总和为0 + 1 + 2 +...+ (x - 2) = (x - 1) * ( x- 2) / 2;
然后扣除掉重...
分类:
其他好文 时间:
2014-05-01 17:16:56
阅读次数:
284
Sports Bags : bags, sport bags are always
highly desirable items used by schools , youth , strength teams players left
college sports alimony thing. T...
分类:
数据库 时间:
2014-05-01 14:26:26
阅读次数:
492
where do i beginto tell a story of how great a love
can bethe sweet love story that is older than the seathe simple truth about the
love she brings to...
分类:
其他好文 时间:
2014-04-29 17:18:46
阅读次数:
342
写写校赛总结。。。。。。。这两次校赛是我们组队以后第一次的比赛。。。第一场打得很拙,第二场还可以吧,第一场校赛--毕竟是期待了很久的校赛,所以感觉还是很紧张,吃饭的时候打了二两,剩了一大半==,
这次我们队名叫 I_Love_High_Math......没走到现场,就快下雨了,真的有点郁闷==。....
分类:
其他好文 时间:
2014-04-28 13:28:57
阅读次数:
503