上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 47 下一页
摘要: 1 class Solution 2 { 3 public: 4 vector> res; 5 int SUM; 6 void dfs(TreeNode* node,int tt,vector tmp) 7 { 8 vector tmp1 = tmp,tmp2 = tmp; 9 ... 阅读全文
posted @ 2018-11-25 20:23 Asurudo 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution 2 { 3 public: 4 bool validateStackSequences(vector& pushed, vector& popped) 5 { 6 stack s; 7 int pushedEnd = -1; 8 for... 阅读全文
posted @ 2018-11-25 18:10 Asurudo 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution 2 { 3 public: 4 int minIncrementForUnique(vector& A) 5 { 6 int a[90000] {0}; 7 for(int i = 0;i =2) 14 { 15 ... 阅读全文
posted @ 2018-11-25 16:36 Asurudo 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 const int maxn = 28; 4 using namespace std; 5 6 int G[maxn][maxn]; 7 int tmpG[maxn][maxn]; 8 int known[maxn]; 9 void DFS(int s) 10 { 11 for(int u=0; u0) 29 ... 阅读全文
posted @ 2018-11-20 20:14 Asurudo 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 const int maxn = 102; 4 using namespace std; 5 6 int G[maxn][maxn]; 7 int n,m; 8 int vis[maxn]; 9 int topo[maxn],tmpN; 10 bool dfs(int u) 11 { 12 vis[u] = -1;//under vi... 阅读全文
posted @ 2018-11-20 19:34 Asurudo 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 核心代码部分参考刘汝佳紫书 阅读全文
posted @ 2018-11-20 18:55 Asurudo 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 using namespace std; 4 5 const int maxn = 200; 6 char g[maxn+3][maxn+3]; 7 int idx[maxn][maxn]; 8 int m,n; 9 string result; 10 11 string hex2bin(char c) 12 { ... 阅读全文
posted @ 2018-11-18 20:23 Asurudo 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 针对UVa 572 阅读全文
posted @ 2018-11-18 19:18 Asurudo 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 1 #define maxn 1000000 2 3 using namespace std; 4 5 struct Node 6 { 7 Node *left,*right; 8 }; 9 10 queue freenodes; 11 Node node[maxn]; 12 13 void init() 14 { 15 for(int i = 0;i ... 阅读全文
posted @ 2018-11-18 18:10 Asurudo 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution 2 { 3 public: 4 vector diStringMatch(string S) 5 { 6 vector tmp {0}; 7 for(auto c:S) 8 { 9 int a = tm... 阅读全文
posted @ 2018-11-18 12:49 Asurudo 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 47 下一页