10 2015 档案

摘要:https://leetcode.com/problems/generate-parentheses/Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthe... 阅读全文
posted @ 2015-10-28 10:00 流白 阅读(834) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/sliding-window-maximum/Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the a... 阅读全文
posted @ 2015-10-27 13:55 流白 阅读(215) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/find-median-from-data-stream/Median is the middle value in an ordered integer list. If the size of the list is even, the... 阅读全文
posted @ 2015-10-27 12:40 流白 阅读(270) 评论(0) 推荐(0)
摘要:#include#include#include#include#include#includeusing namespace std;//****************************************************************// Miller_Rabin ... 阅读全文
posted @ 2015-10-26 15:17 流白 阅读(319) 评论(0) 推荐(0)
摘要:Check whether a given graph is Bipartite or notABipartite Graphis a graph whose vertices can be divided into two independent sets, U and V such that e... 阅读全文
posted @ 2015-10-24 10:09 流白 阅读(196) 评论(0) 推荐(0)
摘要:Course Schedule IITotal Accepted:13015Total Submissions:64067Difficulty:MediumThere are a total ofncourses you have to take, labeled from0ton - 1.Some... 阅读全文
posted @ 2015-10-23 23:14 流白 阅读(276) 评论(0) 推荐(0)
摘要:Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second.For example, in the following graph... 阅读全文
posted @ 2015-10-23 19:48 流白 阅读(298) 评论(0) 推荐(0)
摘要:1 struct edge{ 2 int to,cost; 3 edge(){ this->to = 0; this->cost = 0;} 4 edge(int t){ this->to = t; this->cost = 0;} 5 }; 6 class Solutio... 阅读全文
posted @ 2015-10-23 19:15 流白 阅读(156) 评论(0) 推荐(0)
摘要:1 class Solution { 2 public: 3 int uniquePathsWithObstacles(vector>& obstacleGrid) { 4 if(obstacleGrid.size()==0 || obstacleGrid[0].size(... 阅读全文
posted @ 2015-10-23 14:53 流白 阅读(187) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn = 10; 8 struct edge{ 9 int to, cost;10 edge(in... 阅读全文
posted @ 2015-10-23 11:05 流白 阅读(310) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 struct BST{ 8 int key; 9 BST *lc, *rc;10 BST(){11 ... 阅读全文
posted @ 2015-10-22 16:55 流白 阅读(150) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/n-queens/ 1 class Solution { 2 public: 3 void dfs(vector> &ret, vector> map,int i, int j){ 4 if(i==map.size(... 阅读全文
posted @ 2015-10-22 11:23 流白 阅读(166) 评论(0) 推荐(0)
摘要:Best Time to Buy and Sell StockTotal Accepted:69292Total Submissions:206193Difficulty:MediumSay you have an array for which theithelement is the price... 阅读全文
posted @ 2015-10-16 23:52 流白 阅读(206) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn=6; 8 struct edge{ 9 int to,cost; 10 e... 阅读全文
posted @ 2015-10-15 21:23 流白 阅读(276) 评论(0) 推荐(0)
摘要:1 struct quadruplet{ 2 int a,b,c,d; 3 quadruplet() {} 4 quadruplet(int aa,int bb,int cc,int dd){ 5 this->a=aa; this->b=bb; this->... 阅读全文
posted @ 2015-10-08 21:09 流白 阅读(173) 评论(0) 推荐(0)
摘要://to be continue... 1 class Solution { 2 public: int* buildNext(string T){ 3 int i=1,j; 4 int *next=new int[10000000]; 5 next[... 阅读全文
posted @ 2015-10-01 12:27 流白 阅读(157) 评论(0) 推荐(0)