c++_tree
文章平均质量分 86
**:天下第一
这个作者很懒,什么都没留下…
展开
-
【c++】const 理解
原创 2019-07-06 15:21:12 · 164 阅读 · 0 评论 -
【POJ1679】【次小生成树】【替换边】
The Unique MSTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 24427 Accepted: 8691DescriptionGiven a connected undirected graph, tell if its minimum s原创 2015-08-30 14:37:22 · 367 阅读 · 0 评论 -
【模板】【最小树形图】
#include #include #include #include #include using namespace std;/* * 最小树形图 * int型 * 复杂度O(NM) * 点从0开始 */const int INF = 0x3f3f3f3f;const int MAXN = 1010;const int MAXM = 40010;struct Ed原创 2015-08-29 15:23:25 · 374 阅读 · 0 评论 -
【UVA10600】【次生成树】
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define rep(i,a,n) for (int i=a;i<n;i++)#define per(i,a,n原创 2015-08-30 22:31:27 · 344 阅读 · 0 评论 -
【HDU2121】【有向图的最下生成树】【无固定跟节点】
Ice_cream’s world IITime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3605 Accepted Submission(s): 870Problem DescriptionAfter原创 2015-08-29 21:51:47 · 372 阅读 · 0 评论 -
【UVA11183】【裸朱刘算法】【有向图的最小生成树】
#include #include #include #include #include #include #include #include #include #include #include using namespace std;#define rep(i,a,n) for (int i=a;i<n;i++)#define per(i,a,n) for (int原创 2015-08-29 16:39:13 · 409 阅读 · 0 评论 -
【HDU4081】【次最小生成树变形】【要保持一直的风格】【注意读入数据啊】
Qin Shi Huang's National Road SystemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5381 Accepted Submission(s): 1884Problem Desc原创 2015-08-30 18:01:01 · 384 阅读 · 0 评论 -
【HDU1540】【线段树】【区间合并】【一个PushUp合并还有下去的时候取区间】【可作为模板】
Tunnel WarfareTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5675 Accepted Submission(s): 2194Problem DescriptionDuring the原创 2015-08-26 20:48:09 · 686 阅读 · 0 评论 -
【HDU4553】【2棵线段树】【优先级同步互斥】
约会安排Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 700 Accepted Submission(s): 202Problem Description 寒假来了,又到了小明和女神们约会的季节。原创 2015-08-29 08:46:22 · 371 阅读 · 0 评论 -
【UVA10462】【好题】【次小生成树并查集算法】
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define rep(i,a,n) for (int i=a;i<n;i++)#define per(i,a,n原创 2015-08-30 23:48:12 · 631 阅读 · 1 评论 -
【POJ3164】【有向图的最小生成树】【自己的模板】
Command NetworkTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 14811 Accepted: 4259DescriptionAfter a long lasting war on words, a war on arms fina原创 2015-08-29 16:07:54 · 411 阅读 · 0 评论 -
【c++】详解 link
详解link有 些人写C/C++(以下假定为C++)程序,对unresolved external link或者duplicated external simbol的错误信息不知所措(因为这样的错误信息不能定位到某一行)。或者对语言的一些部分不知道为什么要(或者不要)这样那样设计。了解本文之后, 或许会有一些答案。首先看看我们是如何写一个程序的。如果你在使用某种IDE(Visual Studi...原创 2019-07-06 14:02:46 · 2467 阅读 · 0 评论 -
二叉树的下一个节点
class Solution {public: TreeNode* inorderSuccessor(TreeNode* p) { if (p->right) { p = p->right; while (p->left) { p = p->left; ...原创 2019-06-23 17:12:30 · 123 阅读 · 0 评论 -
无题
对这里不再有太多的留恋。奋力摆脱这里把,离开这里把。我爱过大海,也爱过你。原创 2018-11-21 09:58:57 · 121 阅读 · 0 评论 -
【tarjan】【割点】
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++)#define per(i原创 2015-08-31 19:03:14 · 691 阅读 · 0 评论 -
【Redundant Paths】【无向图】【双连通分量】【缩点】
Redundant PathsTime Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit StatusIn order to get from one of the F(1≤F≤5,000) grazing fields (whic原创 2015-09-02 09:17:09 · 520 阅读 · 0 评论 -
【生成树计数】【矩阵树】【模板】
uva10766#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define rep(i,a,n) for (int i=a;i<n;i++)#define原创 2015-08-31 19:02:34 · 853 阅读 · 0 评论 -
【最小生成树计数】【下标】
#include //hdu 4408#include #include #include #include #include #include #include #include #include #include #include using namespace std;#define rep(i,a,n) for (int i=a;i<n;i++)#defin原创 2015-09-01 09:03:45 · 317 阅读 · 0 评论 -
【hdu4009】【建模】【有向图的最小生成树】
Transfer waterTime Limit: 5000/3000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 4420 Accepted Submission(s): 1567Problem DescriptionXiaoA lives原创 2015-08-29 23:46:12 · 362 阅读 · 0 评论 -
【HDU1255】【线段树】【扫描线】【面积】
覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4417 Accepted Submission(s): 2180Problem Description给定平面上若干矩形,求出被这些矩形覆盖原创 2015-08-28 14:42:39 · 393 阅读 · 0 评论 -
【HDU4614】【线段树】【二分】
Vases and FlowersTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2536 Accepted Submission(s): 979Problem Description Alice i原创 2015-08-28 14:00:34 · 410 阅读 · 0 评论 -
【HDU1698】【线段树成段更新】
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23190 Accepted Submission(s): 11624Problem DescriptionIn the game原创 2015-08-26 19:26:25 · 298 阅读 · 0 评论 -
【HDU1166】【线段树】【单点更新】【左闭右开】
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 60507 Accepted Submission(s): 25648Problem DescriptionC国的死对头A国这段时间正在进行军事演原创 2015-08-26 18:06:31 · 680 阅读 · 0 评论 -
查找二叉树
#include "Search_tree.h"template Binary_node* Search_tree::search_for_node(Binary_node *sub_root, const Record &target) const{if(sub_root==NULL||sub_root->data==target)return sub_root;if(原创 2014-06-01 14:43:31 · 696 阅读 · 0 评论 -
Binary_tree插入
void Tree::insert(Entry &x){if(empty()){root=new Binary_node(x);count++;return;}stack s;int tempcount=size();while(tempcount>0){if(tempcount%2==0)s.push(2);elses.push(1);原创 2014-06-01 11:47:39 · 695 阅读 · 0 评论 -
B_tree的分析
class B_tree {public: // Add public methods.Error_code search_tree(Record &target);Error_code insert(const Record &new_entry);B_tree(); Error_code remove(const Record &target);privat原创 2014-06-11 21:46:01 · 647 阅读 · 0 评论 -
Trie_tree
Error_code Trie::insert(const Record &new_record){Error_code result=success;if(root=NULL)root=new Trie_node;int position=0;char next_char;Trie_node *location=root;while((next_char=原创 2014-06-11 15:49:30 · 629 阅读 · 0 评论 -
AVL_tree的删除
template Error_code AVL_tree::avl_remove(Binary_node *&sub_root, Record &new_data, bool &shorter){Error_code result=success;Record sub_record;if(sub_root==NULL){shorter=false;return no原创 2014-06-07 18:32:43 · 873 阅读 · 0 评论 -
AVL_tree insert的实现代码
template Error_code AVL_tree::avl_insert(Binary_node *&sub_root, const Record &new_data, bool &taller){Error_code result=success;if(sub_root=NULL){sub_root=new Binary_node(new_data);tall原创 2014-06-07 15:26:28 · 934 阅读 · 0 评论 -
【POJ3264】【线段树】【维护多个值】【*4】
Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 40396 Accepted: 18974Case Time Limit: 2000MSDescriptionFor the daily milking, Farme原创 2015-08-26 19:43:09 · 345 阅读 · 0 评论 -
【POJ3468】【线段树成段更新】
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 78730 Accepted: 24266Case Time Limit: 2000MSDescriptionYou have N原创 2015-08-26 19:00:11 · 398 阅读 · 0 评论 -
【HDU1754】【线段树】【单点更新】【4*m】
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 52183 Accepted Submission(s): 20476Problem Description很多学校流行一种比较的习惯。原创 2015-08-26 18:22:42 · 394 阅读 · 0 评论 -
【HDU4578】【代码风格要一致啊啊啊】【数组开大点啊啊啊】
TransformationTime Limit: 15000/8000 MS (Java/Others) Memory Limit: 65535/65536 K (Java/Others)Total Submission(s): 3620 Accepted Submission(s): 873Problem DescriptionYuanfang is原创 2015-08-28 17:14:08 · 486 阅读 · 0 评论 -
【HDU1542】【计算覆盖的面积】【扫描线】【线段树】
AtlantisTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9170 Accepted Submission(s): 3919Problem DescriptionThere are several原创 2015-08-28 13:58:07 · 492 阅读 · 0 评论 -
【HDU3974】【并查集】【技巧】【代码短时间快】
Assign the taskTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1197 Accepted Submission(s): 563Problem DescriptionThere is a原创 2015-08-27 18:55:10 · 619 阅读 · 0 评论 -
【HDU3974】【dfs时间戳建立区间】【线段树】
Assign the taskTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1197 Accepted Submission(s): 563Problem DescriptionThere is a原创 2015-08-27 18:30:11 · 450 阅读 · 0 评论 -
【HDU4072】【线段树】【确定上下界】
Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 10717 Accepted Submission(s): 2480Problem Descriptio原创 2015-08-26 23:04:39 · 448 阅读 · 0 评论 -
【ZOJ1610】【线段树】【建模】【注意端点和线段的区别】
Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KBPainting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your原创 2015-08-26 22:36:31 · 446 阅读 · 0 评论 -
【POJ1171】【线段树+扫描线】【矩形周长】【坑区间要分3类讨论】
Tshirt!Language:DefaultPictureTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 11200 Accepted: 5915DescriptionA number of rectangular原创 2015-08-27 15:46:19 · 539 阅读 · 0 评论 -
【POJ2528】【Mayor's posters】【染色求剩余种类】
Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 51065 Accepted: 14779DescriptionThe citizens of Bytetown, AB, could not stand that the原创 2015-08-27 20:22:15 · 417 阅读 · 0 评论