2014年5月2日

LeetCode---Merge Intervals

摘要: 题目链接区间合并,贪心,需要注意边界情况,LeetCode的数据还是比较好的,这样才能写出健壮的程序。附上代码: 1 /** 2 * Definition for an interval. 3 * struct Interval { 4 * int start; 5 * in... 阅读全文

posted @ 2014-05-02 21:39 Stomach_ache 阅读(147) 评论(0) 推荐(0)

LeetCode---Triangle

摘要: 题目链接很简单的递推,但是写代码的过程中,犯了一个严重的错误,就是我用unsigned int型变量>= 0 作为循环条件(而且是降序)的时候,出现了问题。附上代码: 1 class Solution { 2 public: 3 int minimumTotal(vector > &tria... 阅读全文

posted @ 2014-05-02 21:03 Stomach_ache 阅读(131) 评论(0) 推荐(0)

Hdu 4810

摘要: 2014-05-0215:53:50题目连接2013年南京现场赛的题目,现场的时候,排在我们前面的队伍基本都过了这题,我们后面的队伍也有不少过了这题,唯独我们没有。。后来是Qingyu Shao想到了思路,然后就让他来敲,我记得当时是C(n,k)打表的时候出现了问题,好弱。。于是乎就开始吃东西了。回... 阅读全文

posted @ 2014-05-02 16:45 Stomach_ache 阅读(419) 评论(0) 推荐(0)

导航