单调队列 : code by zhx 手写队列+手写 栈: stack: 队列: STL:中的priority_queue 并查集,启发式合并 把节点较少的合并到节点节点较多的上 是一种优化 杂七杂八的线段树 code by zhx ...
分类:
其他好文 时间:
2017-07-18 22:11:07
阅读次数:
154
#include<stdio.h> #include<algorithm> #include<queue> using namespace std; struct node{ int num; node(int i){ num = i; } }; priority_queue<node>key; b ...
分类:
其他好文 时间:
2017-07-15 13:49:20
阅读次数:
121
介绍: 三个参数:priority_queue<Type,Container, Functional> ①Type:数据类型②:Container:容器(默认是vector)③Functional:元素比较方式 栗子: 按升序排序 ( 按降序排序则把第三个参数改为less<int> ) : ...
分类:
其他好文 时间:
2017-07-14 09:56:00
阅读次数:
160
专题5-数据结构 C++ Primer P329好好研读,stack,queue,priority_queue都是顺序容器适配器adaptor。(接受一种已有的容器类型,使其行为看起来像另一种事物一样) 1、基础知识 1.1、stack栈 1.2、队列queue: C++ primer P330 q ...
分类:
其他好文 时间:
2017-07-12 21:23:29
阅读次数:
293
转自:http://www.cnblogs.com/yangecnu/p/Introduce-Priority-Queue-And-Heap-Sort.html 在很多应用中,我们通常需要按照优先级情况对待处理对象进行处理,比如首先处理优先级最高的对象,然后处理次高的对象。最简单的一个例子就是,在手 ...
分类:
编程语言 时间:
2017-07-11 23:03:12
阅读次数:
167
(以下仅代表个人观点(自己会的),并不是所有noi的考点) 一、STL priority_queue set map vector 二、数据结构 分块 bzoj2821 并查集 ST表 单调栈 树状数组 线段树 可持久化线段树(主席树) Trie树 可持久化Trie树 Treap Splay 树套树 ...
分类:
其他好文 时间:
2017-07-10 10:23:01
阅读次数:
156
#include<iostream> #include<queue> using namespace std; #define read(x) scanf("%lld",&x) int main() { priority_queue<long long,vector<long long>,great ...
分类:
其他好文 时间:
2017-07-08 11:15:44
阅读次数:
126
http://www.cppblog.com/Darren/archive/2009/06/09/87224.html priority_queue用法 priority_queue 调用 STL里面的 make_heap(), pop_heap(), push_heap() 算法实现,也算是堆的另 ...
分类:
其他好文 时间:
2017-06-29 22:31:52
阅读次数:
355
#include #include #include #include #include #include using namespace std; priority_queue,greater > Q; int main(){ int n; int res; int a,b; while(scan... ...
分类:
其他好文 时间:
2017-06-26 16:08:40
阅读次数:
171