
STL
OtterVV
这个作者很懒,什么都没留下…
展开
-
STL B CodeForces620C SET
有连续珍珠n颗,珍珠类型由数字a[I]来表示。一个连续的珍珠序列,如果包含两个相同种类的珍珠,我们就称其为好段。输入:第一行 n - 连续珍珠个数 第二行 n个整数a[I] - 第I颗珍珠的种类输出:第一行 k -这行珍珠序列分区的最大段数 接下来k行 每行包含 l[j], r[j] -第j个区间最左珍珠序号与最右珍珠序号 ...原创 2018-01-25 01:41:05 · 221 阅读 · 0 评论 -
STL C UVA10815 SET
Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the wo...原创 2018-02-04 20:07:45 · 193 阅读 · 0 评论 -
STL F CodeForces527C 割玻璃 set
题意:一块玻璃给定长宽 h,w,给定割玻璃操作次数n,接下来n行给出操作H或V来进行水平或竖直切割,输出每割完一次所切割出的长方形区域中最大的面积。思路:想到利用multiset(可存储相同元素)存储所割长宽间距,利用set存储被切横纵坐标,(insert&erase进行操作),因为set特性,集合内自动排序,利用end()取出长宽间距最大值,相称为最大面积。此处要注意数据范围,s应用...原创 2018-02-15 23:13:39 · 439 阅读 · 0 评论 -
STL G UVA156 multimap
题意:对于给定的一个字典,‘#’结束,大小写混杂,按照字典序输出打乱顺序也无法得到另外一个字典里的单词(不区分大小写)的词(按照原本的大小写)。通过分析题意可知,需要有保留原貌的字符串,所以,以字符串的小写字典序为key值,原型为value进行multimap存储。count得到1的单词放入set中自动进行字典序排序,然后输出。上代码:#include <cstdio>...原创 2018-04-08 01:46:37 · 174 阅读 · 0 评论 -
CSU2160 小Z的培养皿 并查集&SET
Description小Z高中的时候特别喜欢生物,在一次做实验的过程中,小Z配置了n个培养皿,每个培养皿中有着若干种类的细菌,但由于实验室的培养皿数量有限,老师要求小Z尽可能少地使用培养皿。为此,小Z只得将一些培养皿进行混合,但由于一些生物上的特殊要求,只有含有相同细菌的培养皿才能混合,否则细菌将全部死亡。这时候小Z想请求你——CSU(California State Universit...原创 2018-05-29 01:52:19 · 336 阅读 · 0 评论 -
STL UVA-136 Ugly Numbers Set
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... shows the first 11 ugly numbers. By convention, 1 is included. Write a program to ...原创 2018-07-26 21:11:56 · 171 阅读 · 0 评论 -
贪心&二分 CodeForces999D 贪心&二分&set
D. Equalize the Remainderstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array consisting of nn integers a1,a2...原创 2018-08-09 09:42:20 · 236 阅读 · 0 评论 -
HDU6109 并查集&set
数据分割Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2255 Accepted Submission(s): 666 Problem Description小w来到百度之星的赛场上,准备开始实现一个程序自动分析系统...原创 2019-01-21 19:59:46 · 316 阅读 · 1 评论 -
贪心&STL Codeforces1061D
D. TV Showstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn TV shows you want to watch. Suppose the whole time is sp...原创 2019-01-21 21:11:38 · 274 阅读 · 0 评论