紫书
布克波波
这个作者很懒,什么都没留下…
展开
-
uva-540团体队列(queue)
题目不难,重点是如何用queue模拟这个过程,灵活运用queue,数据值较大,需要离散化,此处直接用map进行映射。 #include <iostream> #include <cstring> #include <algorithm> #include <queue> #include <map> #include <deque> using namespace std; const int N = 1e3 + 10; const原创 2022-05-27 13:57:44 · 142 阅读 · 0 评论 -
The SetStack Computer (map+set+vector)
本题最有价值的部分是这个ID函数 map<Set, int>IDcache; vector<Set>Setache; int ID(Set s) { if (IDcache.count(s))return IDcache[s]; Setache.push_back(s); return IDcache[s] = Setache.size() - 1; } 通过这个函数可以讲任意变量映射为一个int值,并通过这个int值可以在vector中查找到映射值原创 2022-05-16 20:34:06 · 113 阅读 · 0 评论