stl
如雨星空
推荐系统在读研究生
展开
-
map常用操作——添入、删除、查找、遍历
/////////////////map添入元素(1)利用pairmapma;ma.insert(pair(2,"LiMing"));或者ma.insert(make_pair(2,"LiMing"));(2)利用map的value_typemapma;ma.insert(map::value_type(2,"LiMing"));(3)利用数组mapma;ma[2] = "原创 2017-10-13 20:18:32 · 11648 阅读 · 0 评论 -
hdu 2022 海选女主角_结构体三级排序
海选女主角Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 48208 Accepted Submission(s): 21402Problem Descriptionpotato老师虽然很喜原创 2016-02-03 18:41:22 · 834 阅读 · 0 评论 -
STL之qsort快排小结
/**********************************对int数组排序a - b与a > b都是从小到大排序,这一点与sort相反***********************************/int cmp(const void *a, const void *b){ return(*(int *)a-*(int *)b);}原创 2016-04-15 12:54:46 · 480 阅读 · 0 评论 -
STL之sort快排小结
/*********************************************sort函数的用法(恰好与qsort相反)//每有新发现都会持续更新做ACM题的时候,排序是一种经常要用到的操作。如果每次都自己写个冒泡之类的O(n^2)排序,不但程序容易超时,而且浪费宝贵的比赛时间,还很有可能写错。STL里面有个sort函数,可以直接对数组排序,复杂度为n*log2(n)。使用这原创 2016-04-15 12:56:04 · 3218 阅读 · 0 评论 -
STL之vector的用法一
介绍这篇文章的目的是为了介绍std::vector,如何恰当地使用它们的成员函数等操作。本文中还讨论了条件函数和函数指针在迭代算法中使用,如在remove_if()和for_each()中的使用。通过阅读这篇文章读者应该能够有效地使用vector容器,而且应该不会再去使用C类型的动态数组了。 Vector总览vector是C++标准模板库中的部分内容,它是一个多功能转载 2016-04-15 22:17:28 · 260 阅读 · 0 评论 -
STL之vector的用法二
vector(向量): C++中的一种数据结构,确切的说是一个类.它相当于一个动态的数组,当程序员无法知道自己需要的数组的规模多大时,用其来解决问题可以达到最大节约空间的目的. 用法: 1.文件包含: 首先在程序开头处加上#include以包含所需要的类文件vector 还有一定要加上us转载 2016-04-15 22:37:19 · 268 阅读 · 0 评论 -
STL之set_uva10815
Problem B: Andy's First DictionaryTime limit: 3 secondsAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number o原创 2016-04-15 23:07:53 · 314 阅读 · 0 评论 -
pair的用法
/** Filename: code.cpp* Created: 2016-04-30* Author: yunlong Wang *[mail:17744454343@163.com]* Desciption: Desciption*/#include #include #include #include #include #include原创 2016-05-01 20:11:44 · 1122 阅读 · 0 评论 -
poj2431 优先队列
ExpeditionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15540 Accepted: 4360DescriptionA group of cows grabbed a truck and ventured on an expedition d原创 2017-04-19 12:16:15 · 371 阅读 · 0 评论 -
poj 3253 优先队列
Fence Repair优先队列原创 2017-04-19 12:43:14 · 449 阅读 · 0 评论 -
poj3481Double Queue之set解法
Double Queue Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15781 Accepted: 6993 DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Buc原创 2017-07-22 11:05:02 · 420 阅读 · 0 评论 -
poj 3253 Fence Repair之优先队列解法
Fence Repair Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 50747 Accepted: 16646 DescriptionFarmer John wants to repair a small length of the fence around the pasture. He me原创 2017-07-22 11:26:40 · 481 阅读 · 0 评论 -
poj 1002 487-3279之map解法
487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 293365 Accepted: 52575 DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone numb原创 2017-07-24 20:07:55 · 919 阅读 · 0 评论 -
poj2970The lazy programmer 优先队列+贪心
The lazy programmerTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 2421 Accepted: 605DescriptionA new web-design studio, called SMART (Simply Masters原创 2017-11-26 22:42:29 · 453 阅读 · 0 评论