数据结构之stl
文章平均质量分 79
曉_寧
这个作者很懒,什么都没留下…
展开
-
stl 初步了解
//动态数组 vector/*assign();对vector 进行赋值at();返回指定位置的元素back() 返回最末元素begin() 返回第一个元素的迭代器capacity() 返回vector 所能容纳的元素数量clear() 清空所有元素empty() 判断vector是否为空end() 返回最末元素的迭代器erase() 删除指定元原创 2014-08-14 00:27:22 · 523 阅读 · 0 评论 -
CodeForces 377B Preparing for the Contest 贪心(二分加优先队列)
题意给出m个bug,每一个bug有个复杂程度,有n个同学每一个同学有自己的能力值b,和想要的东西c,假设雇佣第i个同学,那么能解决全部复杂程度小于等于b[i]的bug,每天一人仅仅能解决一个,学校要付出c,不论i攻克了几个bug问,学校在付出不超过s,且最少的天数须要多少。有两个限制,1.总和不能超过s,2.要求最少天数。仅仅能限制一个,来求还有一个,假设求总和不能原创 2015-03-10 19:52:46 · 908 阅读 · 0 评论 -
poj 2442 Sequence stl'练习
DescriptionGiven m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It's clear that we may get n ^ m this kind原创 2014-08-14 00:19:51 · 574 阅读 · 0 评论 -
快排对二维字符排序
今天出来实习的第四天实在无聊,就偷偷写着玩给一个字符二维数组让你按字典序进行排序#include#include#include#include#include#includeusing namespace std;bool compare(char *p1,char *p2){ if (strcmp(p1,p2)<0) return true; else原创 2015-01-08 16:53:04 · 519 阅读 · 0 评论 -
Message Flood
题目描述Well, how do you feel about mobile phone? Your answer would probably be something like that "It's so convenient and benefits people a lot". However, If you ask Merlin this question on the New Ye原创 2014-02-18 13:55:47 · 689 阅读 · 0 评论 -
Sicilly 1194 Message Flood
DescriptionWell, how do you feel about mobile phone? Your answer would probably be something like that "It's so convenient and benefits people a lot". However, If you ask Merlin this question on t原创 2014-08-13 21:37:52 · 576 阅读 · 0 评论 -
poj 3096 Surprising Strings
DescriptionThe D-pairs of a string of letters are the ordered pairs of letters that are distance D from each other. A string is D-unique if all of its D-pairs are different. A string is surprisi原创 2014-08-13 21:32:15 · 494 阅读 · 0 评论 -
poj 2418 Hardwood Species
DescriptionHardwoods are the botanical group of trees that have broad leaves, produce a fruit or nut, and generally go dormant in the winter. America's temperate climates produce forests with原创 2014-08-13 21:24:18 · 498 阅读 · 0 评论 -
Fermat’s Chirstmas Theorem
DescriptionIn a letter dated December 25, 1640; the great mathematician Pierre de Fermat wrote to Marin Mersenne that he just proved that an odd prime p is expressible as p = a2 + b2 if and only i原创 2014-08-14 00:16:58 · 565 阅读 · 0 评论 -
poj2528 Mayor's posters
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city coun原创 2014-08-13 21:21:16 · 512 阅读 · 0 评论 -
树-堆结构练习——合并果子之哈夫曼树
Description 在一个果园里,多多已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆。多多决定把所有的果子合成一堆。每一次合并,多多可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之和。可以看出,所有的果子经过n-1次合并之后,就只剩下一堆了。多多在合并果子时总共消耗的体力等于每次合并所消耗体力之和。Input 第一行是一个整数n(1原创 2014-08-13 21:21:05 · 758 阅读 · 0 评论 -
poj1442 Black Box stl函数练习
DescriptionOur Black Box represents a primitive database. It can save an integer array and has a special i variable. At the initial moment Black Box is empty and i equals 0. This Black Box proce原创 2014-08-14 00:21:24 · 585 阅读 · 0 评论