返回顶部
摘要: #include<cstdio>#include<iostream>#include<stdlib.h>#include<queue>using namespace std;typedef struct BTree{ int data; BTree *lchild; BTree *rchild; } 阅读全文
posted @ 2020-08-11 21:50 tianyudizhua 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> #include<vector> using namespace std; const int maxn=20; int n,k,x,maxSumSqu=-1,A[maxn]; vector<int>temp,ans; void DFS(int index,int 阅读全文
posted @ 2020-08-11 20:37 tianyudizhua 阅读(204) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> const int maxn=30; int n,V,maxValue=0; int w[maxn],c[maxn]; void DFS(int index,int sumW,int sumC) { if(index==n) { return; } DFS(inde 阅读全文
posted @ 2020-08-11 20:17 tianyudizhua 阅读(89) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> const int maxn=30; int n,V,maxValue=0; int w[maxn],c[maxn]; void DFS(int index,int sumW,int sumC) { if(index==n) { if(sumW<=V&&sumC>m 阅读全文
posted @ 2020-08-11 20:15 tianyudizhua 阅读(90) 评论(0) 推荐(0) 编辑
摘要: void BFS(int s) { queue<int>q; q.push(s); while(!q.empty()) { //取出队首元素top //访问队首元素top //将队首元素出队 //将top的下一次结点中未曾入队的结点全部入队,标记层号为now的层号+1并设置为已入队 } } 阅读全文
posted @ 2020-08-11 20:00 tianyudizhua 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; const int maxn=100; struct node { int x,y; int step; }S,T, 阅读全文
posted @ 2020-08-11 19:51 tianyudizhua 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<queue> using namespace std; const int maxn=100; struct node { int x,y; } Node; int n,m; int matrix[maxn][ 阅读全文
posted @ 2020-08-11 17:10 tianyudizhua 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> #include<cstdio> #include<cstring> using namespace std; const int maxsize=16; int a[maxsize][maxsize]= {0}; bool b 阅读全文
posted @ 2020-08-11 16:18 tianyudizhua 阅读(93) 评论(0) 推荐(0) 编辑