STL
文章平均质量分 76
圣诞老人家
这个作者很懒,什么都没留下…
展开
-
poj 1833(STL中排列函数和copy()的应用)
题目描述:大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3 1,3 1 2,3 2 1六个排列。任务描述:给出某个排列,求出这个排列的下k个排列,如果遇到最后一个排列,则下1排列为第1个排列,即排列1 2 3…n。比如:n = 3,k=2 给出排列2 3 1,则它的下...原创 2019-10-13 15:10:05 · 135 阅读 · 0 评论 -
hdu 6168 模拟+优先队列
zk has n numbers a1,a2,...,an. For each (i,j) satisfying 1≤i(ai+aj). These new numbers could make up a new sequence b1,b2,...,bn(n−1)/2.LsF wants to make some trouble. While zk is sleeping, Lsf原创 2017-08-23 10:46:39 · 204 阅读 · 0 评论 -
优先队列详解
首先队列的特征大家都知道,就是先进先出,但是在有些时候我们需要队列所存的数据按照一定的优先级输出,这个时候我们就可以用优先队列解决了1.头文件2.变量声明priority_queue 变量名3.优先级priority_queue, less > 大的优先级大priority_queue<int, vector, greater > 小的优先级大当原创 2017-08-23 09:49:16 · 330 阅读 · 0 评论 -
STL之set篇
关于set有下面几个问题:(1)为何map和set的插入删除效率比用其他序列容器高?大部分人说,很简单,因为对于关联容器来说,不需要做内存拷贝和内存移动。说对了,确实如此。set容器内所有元素都是以节点的方式来存储,其节点结构和链表差不多,指向父节点和子节点。结构图可能如下: A / \ B C / \ / \ D E F转载 2017-03-30 18:40:48 · 217 阅读 · 0 评论 -
hdu 4585 shaolin Stl--map
Shaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there. The master of Shaolin evaluates a young man mainly by his talent on un原创 2017-03-30 17:13:36 · 318 阅读 · 0 评论 -
sTL 之map篇
Map是c++的一个标准容器,她提供了很好一对一的关系,在一些程序中建立一个map可以起到事半功倍的效果,总结了一些map基本简单实用的操作!1. map最基本的构造函数; mapmapstring; mapmapint; mapmapstring; mapmapchar; mapmapchar; mapmapint原创 2017-03-30 17:03:35 · 460 阅读 · 0 评论 -
uva1592 Database
Peter studies the theory of relational databases. Table in the relational database consists of values tare arranged in rows and columns.There are di?erent normal forms that database may adhere to.原创 2017-04-08 22:10:27 · 460 阅读 · 0 评论 -
Double Queue set解法
The new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern information technologie原创 2017-01-20 11:58:30 · 450 阅读 · 0 评论 -
set内各种函数的应用
【序言】以前一直仰慕着STL,趁着有空我就来研究一下。【set的介绍】据说set可以完全代替优先队列(queue)。set的本质是一个红黑树。当然,set也可以用作去重,因为每一个数据只出现一次。如果要多次,可以用multiset,原理和set一样。【头文件】include【基本操作】q.insert(x)把元素x插入红黑树q中。q.find(x)返回元原创 2017-01-18 21:41:40 · 328 阅读 · 0 评论 -
poj 3481--Double Queue
The new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern information technologie原创 2017-01-18 20:35:49 · 283 阅读 · 0 评论