随笔分类 - leetcode
摘要:Course Schedule IITotal Accepted:13015Total Submissions:64067Difficulty:MediumThere are a total ofncourses you have to take, labeled from0ton - 1.Some...
阅读全文
摘要: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...
阅读全文
摘要:1 class Solution { 2 public: 3 int uniquePathsWithObstacles(vector>& obstacleGrid) { 4 if(obstacleGrid.size()==0 || obstacleGrid[0].size(...
阅读全文
摘要: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(...
阅读全文
摘要:Best Time to Buy and Sell StockTotal Accepted:69292Total Submissions:206193Difficulty:MediumSay you have an array for which theithelement is the price...
阅读全文
摘要: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->...
阅读全文
摘要://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[...
阅读全文

浙公网安备 33010602011771号