STL
文章平均质量分 76
github.com/4gnosed
这个作者很懒,什么都没留下…
展开
-
UVA 156 Ananagrams (map应用)
Most crossword puzzle fans are used to anagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute,原创 2017-09-24 11:58:26 · 226 阅读 · 0 评论 -
UVA 136 Ugly Number(优先队列)
题目 Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...shows the first 11 ugly numbers. By convention, 1 is included.原创 2017-09-29 23:26:58 · 282 阅读 · 0 评论 -
UVA 230 Borrowers(多种STL运用)
详细题目:https://vjudge.net/problem/UVA-230思路:根据题意先对各本书进行排序(按ASCII码先作者后书名),建立一个结构体 book 对每本书的作者和状态(入藏,借出,归还但未上架)进行储存,并通过建立 map 的键值关系。对于每次 SHELVE 操作,找到第三种状态的书,确定其插入的位置(先前排序的作用于此)。代码:#include #incl原创 2017-10-08 16:55:45 · 270 阅读 · 0 评论 -
UVA 540 Team Queue(queue的使用)
Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it occurs often in everyday life. At lunch time the qu原创 2017-09-27 23:46:14 · 284 阅读 · 0 评论 -
UVA 1592 Database(map)
Peter studies the theory of relational databases. Table in the relational database consists of values that are arranged in rows and columns.There are different normal forms that database may adher原创 2017-09-18 23:46:11 · 488 阅读 · 0 评论 -
标准模板库(STL)
1.标准模板库(STL)2.容器类3.迭代器4.函数对象(functors)5.STL算法原创 2017-09-16 14:34:51 · 298 阅读 · 0 评论 -
迭代器的使用
几种迭代器 ostream_iterator , back_insert_iterator ,insert_iterator 的用法如下:#include #include #include #include #include using namespace std;int main(){ char a[6]={'a','b','c','d','f','g'};原创 2017-09-16 21:42:43 · 216 阅读 · 0 评论 -
UVA 12096 The SetStack Computer(stack及其它STL容器综合使用)
Background from Wikipedia: “Set theory is a branch of mathematics created principally by the German mathe-matician Georg Cantor at the end of the 19th century.Initially controversial, set theory has c原创 2017-09-25 20:54:38 · 295 阅读 · 0 评论 -
UVA 10815 Andy's First Dictionary(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原创 2017-09-21 23:15:59 · 214 阅读 · 0 评论 -
算术中缀表达式求值(栈实现)
问题描述:输入由整型分量和操作符组成的中缀表达式,输出其后缀表达式和运算的结果。整型分量:十进制数。操作符:( , ) , + , - , * , / 。如输入3*(5-8/2)+7,输出 3 5 8 2 / - * 7 +,结果是10;输入3-(1/4+7)*3 ,输出 3 1 4 / 7 + 3 * -,结果是 -18.75;输入3*4/5*(5-7)+4,输出 3 4 * 5 / 5 7 -...原创 2017-10-29 10:29:00 · 20854 阅读 · 3 评论