Find all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combination should be a u...
分类:
其他好文 时间:
2015-05-25 20:20:34
阅读次数:
130
Sprint计划一、 现状网页投票系统的设计已经有了大概的布局,对于网页设计的代码还不太熟悉,连接数据库成功的做到了增添和删除功能。二、 任务认领1:对类似项目《问卷星》的借鉴I;分析“问卷星”优点Ii:分析“问卷星”缺点Iii::分析“问卷星网页交互”优点V:分析“问卷星网页交互”缺点2:网页布局...
分类:
其他好文 时间:
2015-05-25 20:04:03
阅读次数:
132
Combination Sum III
Find all possible combinations of k numbers that add up to a number n, given that only numbers
from 1 to 9 can be used and each combination should be a unique set of numbers...
分类:
其他好文 时间:
2015-05-25 18:48:23
阅读次数:
100
Typical recursion usage.class Solution { vector> ret; void dfs(vector curr, int currSum, int maxN, int n, int k) { // Ending ...
分类:
其他好文 时间:
2015-05-25 16:20:29
阅读次数:
136
LeetCode Combination Sum III题目思路DFS代码class Solution {
public:
vector<vector> Ans;
vector AnAns;
int K;
int N;
vector<vector > combinationSum3(int k, int n) {...
分类:
其他好文 时间:
2015-05-25 10:01:27
阅读次数:
126
http://acm.hdu.edu.cn/showproblem.php?pid=1181这道题可以用多种方法写,我用了两种方法,都是用java写的。BFS注意java中使用的queue接口是需要实例化为LinkedList,queue接口的方法有:add增加一个元索如果队列已满,则抛出一个III...
分类:
其他好文 时间:
2015-05-23 23:54:42
阅读次数:
197
I title:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime co...
分类:
其他好文 时间:
2015-05-23 20:03:35
阅读次数:
162
题解:根据题目要求,最多进行两次买卖股票,而且手中不能有2只股票,就是不能连续两次买入操作。所以,两次交易必须是分布在2各区间内,也就是动作为:买入卖出,买入卖出。进而,我们可以划分为2个区间[0,i]和[i,len-1],i可以取0~len-1。那么两次买卖的最大利润为:在两个区间的最大利益和的最...
分类:
其他好文 时间:
2015-05-22 09:30:06
阅读次数:
143
Sprint计划一、 现状 网页的设计已经有了大概的布局,对于网页设计的代码还不太熟悉,连接数据库有一定的困难,还未接触动态网页设计。二、 任务认领 1:对类似项目的观赏I;分析“e饿了么”优点Ii:分析“饿了么”缺点Iii::分析“网上火车订票”优点V:分析“网上火车订票”缺点 2:...
分类:
其他好文 时间:
2015-05-20 23:52:35
阅读次数:
192
汉诺塔II:(hdu1207)/先说汉若塔I(经典汉若塔问题),有三塔,A塔从小到大从上至下放有N个盘子,如今要搬到目标C上,规则小的必需放在大的上面,每次搬一个,求最小步数。这个问题简单,DP:a[n]=a[n-1]+1+a[n-1],先把上面的n-1个放在B上,把最大的放在目标C上,再把N-1个...
分类:
其他好文 时间:
2015-05-16 21:48:27
阅读次数:
127