摘要:
std::pair是二元组类模板,就是表示两种相互关联的事物。make_pair实际上是一个创建二元组的便利函数模板,这里用到了C++函数模板的模板参数可省略的特性,不使用这个函数模板的话,每次你要创建一个二元组必须写明模板参数。 如: 1 2 std::pair<char, int> a( 'a' 阅读全文
posted @ 2019-01-22 00:44
DWVictor
阅读(1222)
评论(0)
推荐(0)
摘要:
全排列 https://www.cnblogs.com/DWVictor/p/10301666.html #include <bits/stdc++.h> using namespace std; int dir[4][2]={1,0,-1,0,0,1,0,-1}; int Hash[4]; cha 阅读全文
posted @ 2019-01-22 00:37
DWVictor
阅读(269)
评论(0)
推荐(0)
摘要:
目标 STL中的next_permutation 函数和 prev_permutation 两个函数提供了对于一个特定排列P,求出其后一个排列P+1和前一个排列P-1的功能。 这里我们以next_permutation 为例分析STL中实现的原理,prev_permutation 的原理与之类似,我 阅读全文
posted @ 2019-01-22 00:35
DWVictor
阅读(3109)
评论(0)
推荐(2)

浙公网安备 33010602011771号