摘要: Making the GradeTime Limit:1000MSMemory Limit:65536KTotal Submissions:3436Accepted:1608DescriptionA straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a single slope, but they are not fond of an alt... 阅读全文
posted @ 2013-11-02 13:13 码代码的猿猿 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 左偏树是一种不平衡的二叉树,特点是:堆+快速的合并 每个结点包含4个元素v,d,r,l。。。。右边的D总是比左边的D小。。。向左偏。。。。合并操作都是向右边的子树递归的,时间复杂度低O(log(n1)+log(n2))。因为合并比较快。。。所以。。基本操作大都是用合并完成的。。。。。写起来非常简单。。。。 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 const int maxn=100010; 8 int tot=0; 9 10 struct leftistheapnode11 {12 int v... 阅读全文
posted @ 2013-11-02 01:00 码代码的猿猿 阅读(255) 评论(0) 推荐(0) 编辑