上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 题目通道:POJ 2418 第一次用map,中间费了点周折,string类的输入输出一直存在问题,string类不能scanf直接输入,要提前预订大小,string a; a.resize(100); scanf("%s",&a[0]); 如果多个字符串输入,用getline(cin, s)即可,空 阅读全文
posted @ 2020-08-08 19:33 不敢说的梦 阅读(147) 评论(0) 推荐(0)
摘要: map基本操作和使用: map是STL的一个关联容器,提供一对一的数据处理能力,底层是一棵红黑树,并且有自动排序功能。map可以修改值,但不能修改key。key和vaule可以是任意你需要的类型,map查找元素的复杂度大概是O(log n) map构造: 例如:map<int, string> ma 阅读全文
posted @ 2020-08-08 18:17 不敢说的梦 阅读(206) 评论(0) 推荐(0)
摘要: 题目跳转:POJ 3349 Describe: You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. 阅读全文
posted @ 2020-08-08 16:46 不敢说的梦 阅读(144) 评论(0) 推荐(0)
摘要: 这道题用的词典来解的,应该也可以用Trie树(但是我暂时不会): 词典就是一个键值Key,和一个对应的值Value 前往题目:POJ 2503 Describe: You have just moved from Waterloo to a big city. The people here spe 阅读全文
posted @ 2020-08-07 12:31 不敢说的梦 阅读(116) 评论(0) 推荐(0)
摘要: 题目链接:ZOJ 3210 Describe: Do you know stack and queue? They're both important data structures. A stack is a "first in last out" (FILO) data structure an 阅读全文
posted @ 2020-08-07 00:24 不敢说的梦 阅读(151) 评论(0) 推荐(0)
摘要: 总结一些queue常用的函数: 队列有三种: 顺序队列 优先队列 双端队列 顺序队列构造:queue<value_type> queue_name 函数: que.push() que.pop() 队首元素出队,不返回值 que.front() 查看对首元素 que.back() 查看队尾元素 qu 阅读全文
posted @ 2020-08-07 00:14 不敢说的梦 阅读(204) 评论(0) 推荐(0)
摘要: 典型的表达式求值问题 栈来解决表达式问题,构建两个栈,一个是运算数栈,一个是运算符栈。 这篇题解应该是这道题里最麻烦的题解了,没有之一 题目链接:POJ 2106 Describe: The objective of the program you are going to produce is t 阅读全文
posted @ 2020-08-06 18:49 不敢说的梦 阅读(411) 评论(0) 推荐(0)
摘要: 题目传送门:POJ 1363 Descirbe: There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. 阅读全文
posted @ 2020-08-06 12:04 不敢说的梦 阅读(350) 评论(0) 推荐(0)
摘要: C++中的stack是一个容器,一个先进后出的数据结构。 需要头文件:<stack> 构造:(这段看别人写的挺好,抄的) template <class T, class Container = deque<T> > class stack; 如上,这对尖括号中有两个参数,第一个是T,表示栈中存放的 阅读全文
posted @ 2020-08-05 16:54 不敢说的梦 阅读(275) 评论(0) 推荐(0)
摘要: 题目链接:POJ 3461 Describe: The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the 阅读全文
posted @ 2020-08-05 14:29 不敢说的梦 阅读(179) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 下一页