
stl
文章平均质量分 86
xuejye
123
展开
-
c++ vector(1)
原文链接:http://www.cnblogs.com/wang7/archive/2012/04/27/2474138.html点击打开链接在c++中,vector是一个十分有用的容器,下面对这个容器做一下总结。1 基本操作(1)头文件#include.(2)创建vector对象,vector vec;(3)尾部插入数字:vec.push_back(a转载 2017-06-10 02:11:43 · 381 阅读 · 0 评论 -
HDU 3328 Flipper(优先队列)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3328点击打开链接FlipperTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 922 Accepted Subm原创 2017-06-04 23:22:54 · 346 阅读 · 0 评论 -
set(2)and multiset
一、set和multiset基础set和multiset会根据特定的排序准则,自动将元素进行排序。不同的是后者允许元素重复而前者不允许。需要包含头文件:#include set和multiset都是定义在std空间里的类模板:[cpp] view plain copy print?templatec转载 2017-07-10 13:02:36 · 282 阅读 · 0 评论 -
51Nod - 1163 最高的奖励 (优先队列)
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1163点击打开链接1163 最高的奖励基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题有N个任务,每个任务有一个最晚结束时间以及一个对应的奖励。在结束时间之前完成该任务,就可以原创 2017-07-24 18:40:05 · 295 阅读 · 0 评论 -
CodeForces - 357C Knight Tournament (set乱搞/并查集)
题目链接http://codeforces.com/problemset/problem/357/C点击打开链接C. Knight Tournamenttime limit per test3 secondsmemory limit per test256 megabytesinputstandard input原创 2017-07-26 10:15:02 · 292 阅读 · 0 评论 -
CodeForces - 367B Sereja ans Anagrams(队列+map)
题目链接:http://codeforces.com/problemset/problem/367/B点击打开链接B. Sereja ans Anagramstime limit per test1 secondmemory limit per test256 megabytesinputstandard input原创 2017-07-26 10:18:32 · 291 阅读 · 0 评论 -
POJ - 3494 Largest Submatrix of All 1’s(单调栈)
题目链接:http://poj.org/problem?id=3494点击打开链接Largest Submatrix of All 1’sTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 6674 Accepted: 2472Case Time Lim原创 2017-07-26 10:26:51 · 319 阅读 · 0 评论 -
CodeForces 830B Cards Sorting(set乱搞)
题目链接:http://codeforces.com/problemset/problem/830/B点击打开链接B. Cards Sortingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstand原创 2017-08-22 18:22:24 · 497 阅读 · 0 评论 -
CodeForces - 359D Pair of Numbers (单调栈)
题目链接:http://codeforces.com/problemset/problem/359/D点击打开链接D. Pair of Numberstime limit per test2 secondsmemory limit per test256 megabytesinputstandard input原创 2017-09-05 17:56:40 · 385 阅读 · 0 评论 -
51Nod 1791 合法括号子段(栈+乱搞)
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1791点击打开链接1791 合法括号子段基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题有一个括号序列,现在要计算一下它有多少非空子段是合法括号序列。合法括号序列的原创 2017-08-23 22:52:23 · 386 阅读 · 0 评论 -
Codeforces Round #413 C. Fountains(优先队列乱搞/树状数组/线段树)
题目链接:http://codeforces.com/contest/799/problem/C点击打开链接C. Fountainstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutput原创 2017-07-11 15:47:08 · 443 阅读 · 0 评论 -
CodeForces - 632C The Smallest String Concatenation(string乱搞)
题目链接:http://codeforces.com/problemset/problem/632/C点击打开链接C. The Smallest String Concatenationtime limit per test3 secondsmemory limit per test256 megabytesinp原创 2017-09-01 22:27:05 · 304 阅读 · 0 评论 -
poj 3253 Fence Repair(优先队列+贪心)
题目链接:http://poj.org/problem?id=3253点击打开链接Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 50168 Accepted: 16434DescriptionFarmer原创 2017-07-17 22:55:33 · 229 阅读 · 0 评论 -
CodeForces - 501B Misha and Changing Handles(map用法)
题目链接:http://codeforces.com/problemset/problem/501/B点击打开链接B. Misha and Changing Handlestime limit per test1 secondmemory limit per test256 megabytesinputstandard input原创 2017-11-11 20:19:16 · 315 阅读 · 0 评论 -
CodeForces 747C Servers(优先队列)
题目链接:http://codeforces.com/problemset/problem/747/C点击打开链接C. Serverstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstan原创 2018-01-02 20:23:59 · 347 阅读 · 0 评论 -
HDU - 1058 Humble Numbers (2 3 5 7丑数)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058点击打开链接Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 27993 Accept原创 2018-01-22 11:48:45 · 377 阅读 · 0 评论 -
UVA - 1198 && POJ - 1612 The Geodetic Set Problem (floyd+set+模拟)
题目链接:http://poj.org/problem?id=1612点击打开链接The Geodetic Set ProblemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 760 Accepted: 264DescriptionLet原创 2018-01-01 20:42:44 · 393 阅读 · 0 评论 -
CodeForces - 798B Mike and strings (暴力+stl)
题目链接:http://codeforces.com/problemset/problem/798/B点击打开链接B. Mike and stringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard input原创 2018-01-09 14:28:18 · 2091 阅读 · 0 评论 -
qduoj 一道简单的数据结构题(水题)
题目链接:https://qduoj.com/problem/147/点击打开链接一道简单的数据结构题发布时间: 2017年6月3日 18:46 最后更新: 2017年6月3日 18:51 时间限制: 1000ms 内存限制: 128M描述如果插入“+”和“1”到一个括号序列,我们能得到一个正确的数学表达式,我们就认为这个括号序列是合法的。例原创 2017-06-06 01:19:58 · 827 阅读 · 0 评论 -
POJ 2796:Feel Good (单调栈)
题目链接:http://poj.org/problem?id=2796点击打开链接Feel GoodTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 14719 Accepted: 4082Case Time Limit: 1000MS Special原创 2017-07-17 22:38:35 · 223 阅读 · 0 评论 -
c++ vector(2)
原文链接:http://blog.youkuaiyun.com/hancunai0017/article/details/7032383点击打开链接vector(向量): C++中的一种数据结构,确切的说是一个类.它相当于一个动态的数组,当程序员无法知道自己需要的数组的规模多大时,用其来解决问题可以达到最大节约空间的目的. 用法: 1.文件包含:转载 2017-06-10 02:13:33 · 422 阅读 · 0 评论 -
memset
1. memset()函数原型是extern void *memset(void *buffer, int c, int count) buffer:为指针或是数组, c:是赋给buffer的值, count:是buffer的长度. 这个函数在socket中多用于清空数组.如:原型是memset(buffe转载 2017-06-17 22:37:09 · 202 阅读 · 0 评论 -
STL源码学习----lower_bound和upper_bound算法
STL中的每个算法都非常精妙,接下来的几天我想集中学习一下STL中的算法。 ForwardIter lower_bound(ForwardIter first, ForwardIter last,const _Tp& val)算法返回一个非递减序列[first, last)中的第一个大于等于值val的位置。 ForwardIter upper_bound(ForwardI转载 2017-06-17 22:39:59 · 306 阅读 · 0 评论 -
优先队列
转载原文http://blog.youkuaiyun.com/senyelicone/article/details/51850284点击打开链接[cpp] view plain copy#include #include using namespace std; priority_queueint> da; //大根转载 2017-06-05 00:02:38 · 304 阅读 · 0 评论 -
CodeForces - 831C Jury Marks (set思维)
题目链接:http://codeforces.com/problemset/problem/831/C点击打开链接C. Jury Markstime limit per test2 secondsmemory limit per test256 megabytesinputstandard input原创 2017-07-20 19:17:55 · 259 阅读 · 0 评论 -
CodeForces - 821C Okabe and Boxes(思维)
题目链接:http://codeforces.com/problemset/problem/821/C点击打开链接C. Okabe and Boxestime limit per test3 secondsmemory limit per test256 megabytesinputstandard i原创 2017-07-20 19:32:38 · 318 阅读 · 0 评论 -
poj 3250 Bad Hair Day(单调栈)
题目链接:http://poj.org/problem?id=3250点击打开链接Bad Hair DayTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 19144 Accepted: 6515DescriptionSome of原创 2017-07-17 23:04:12 · 191 阅读 · 0 评论 -
hdu 4006 The kth great number(优先队列)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4006点击打开链接The kth great numberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 113原创 2017-07-17 23:07:51 · 360 阅读 · 0 评论 -
vector(3)
学习C++ -> 向量(vector)一、向量的介绍 向量 vector 是一种对象实体, 能够容纳许多其他类型相同的元素, 因此又被称为容器。 与string相同, vector 同属于STL(Standard Template Library, 标准模板库)中的一种自定义的数据类型, 可以广义上认为是数组的增强版。 在使用它时, 需要包含转载 2017-07-10 11:22:16 · 414 阅读 · 0 评论 -
set(1)
STL中的set容器的一点总结1.关于setC++ STL 之所以得到广泛的赞誉,也被很多人使用,不只是提供了像vector, string, list等方便的容器,更重要的是STL封装了许多复杂的数据结构算法和大量常用数据结构操作。vector封装数组,list封装了链表,map和set封装了二叉树等,在封装这些数据结构的时候,STL按照程序员的使用习惯,以成员函数方式提供的常用转载 2017-07-10 12:55:34 · 394 阅读 · 0 评论 -
set(3)
C++ STL set和multiset的使用std::set s;那个s这个对象里面存贮的元素是从小到大排序的,(因为用std::less作为比较工具。)1,set的含义是集合,它是一个有序的容器,里面的元素都是排序好的,支持插入,删除,查找等操作,就 像一个集合一样。所有的操作的都是严格在logn时间之内完成,效率非常高。 set和multiset的区别是:set插入的元转载 2017-07-10 13:12:22 · 323 阅读 · 0 评论 -
CodeForces 828C String Reconstruction(思维)
题目链接:http://codeforces.com/contest/828/problem/C点击打开链接C. String Reconstructiontime limit per test2 secondsmemory limit per test256 megabytesinputstandar原创 2017-07-12 17:30:33 · 421 阅读 · 0 评论 -
POJ - 3190 Stall Reservations (优先队列)
题目链接:http://poj.org/problem?id=3190点击打开链接Stall ReservationsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7375 Accepted: 2621 Special JudgeDesc原创 2017-07-21 20:13:54 · 267 阅读 · 0 评论 -
ZOJ - 2724 Windows Message Queue (优先队列)
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2724点击打开链接Windows Message QueueTime Limit: 2 Seconds Memory Limit: 65536 KBMessage queue is the basic fundament原创 2017-07-21 20:55:49 · 360 阅读 · 0 评论 -
HDU - 1896 Stones(优先队列)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1896点击打开链接StonesTime Limit: 5000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2885 Accepted Su原创 2017-07-22 16:00:07 · 358 阅读 · 0 评论 -
51Nod - 1349 最大值(单调栈)
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1349点击打开链接1349 最大值基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注有一天,小a给了小b一些数字,让小b帮忙找到其中最大的原创 2017-07-23 01:10:07 · 385 阅读 · 0 评论 -
Codeforces 799B - T-shirt buying(set / 优先队列)
题目链接:http://codeforces.com/problemset/problem/799/B点击打开链接B. T-shirt buyingtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutput原创 2017-07-11 15:41:40 · 338 阅读 · 0 评论 -
HDU - 3282 Running Median (动态中位数+优先队列)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3282点击打开链接Running MedianTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1199 Accepte原创 2018-01-26 21:11:44 · 507 阅读 · 0 评论