STL
hxc2101
这个作者很懒,什么都没留下…
展开
-
一些容器的排序
vector:元素为 int 之类的:vector<int>vec;sort(vec.begin(),vec.end(),greater<int>()); //降序sort(vec.begin(),vec.end(),less<int>()); //升序元素为pair之类的(struct 同理,也是写个cmp即可):vector&l...原创 2018-08-18 02:02:21 · 684 阅读 · 0 评论 -
random_shuffle() 随机化
转自:https://blog.csdn.net/vivi_wang_11/article/details/7441803其他文章:https://blog.csdn.net/lionet_whitney/article/details/51086172STL中的函数random_shuffle()用来对一个元素序列进行重新排序(随机的),函数原型如下:template<cla...转载 2018-09-11 21:33:09 · 23578 阅读 · 0 评论