随笔分类 - PTA程序设计
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int N = 1111; vector<int> G[N];//邻接表 bool
阅读全文
摘要:堆的详细创建过程:参考:https://www.jianshu.com/p/21bef3fc3030 明白堆的详细创建过程的前提是要理解Shift Down。 但是这明显不符合最大堆的定义,所以我们需要让该完全二叉树转换成最大堆!怎么转换成一个最大堆呢? 最大堆有一个特点就是其各个子树都是一个最大堆
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int N = 1010; int father[N]; int isRoot[N]
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 110; struct node{ int v,height;
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 1010; int temp[maxn],initial[ma
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; struct node{ int data; node *left; node *right;
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int MAXN = 110; struct Node{ int weight; v
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 100010; struct node{ //bool lea
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 100010; vector<int> child[maxn]
阅读全文
摘要:法1:BFS #include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 100010; vector<int> temp
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 100010; struct node{ double dat
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 100010; vector<int> child[maxn]
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 110; struct node{ int lchild,rc
阅读全文
摘要:#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int maxn = 50; struct node{ int data; node
阅读全文
摘要:若直接DFS递归求解,会栈溢出 #include <cstdio> #include <cstring> #include <queue> #include <algorithm> using namespace std; const int maxn=50; struct node{ int da
阅读全文
摘要:#pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; struct node{ int x, y, z; }p; int m, n, l,
阅读全文
摘要:#include <bits/stdc++.h> #include<math.h> #include <string> using namespace std; //maxFacSum 记录最大底数之和 int n,k,p,maxFaceSum = -1; vector<int> fac,ans,t
阅读全文
摘要:#include <bits/stdc++.h> #include<math.h> #include <string> using namespace std; const int maxn = 100005; const int TABLE = 1000010; struct Node{//定义静
阅读全文
摘要:自己写的,少了异常处理。 #include <bits/stdc++.h> #include<math.h> #include <string> using namespace std; const int maxn = 100010; struct Node{//定义静态链表 int data;
阅读全文
摘要:#include <bits/stdc++.h> #include<math.h> #include <string> using namespace std; const int maxn = 100010; struct Node{//定义静态链表 char data; int next; bo
阅读全文
posted @ 2020-01-18 20:11
JasonPeng1