摘要: 详细解说 STL 排序(Sort)作者Winter原文地址:http://www.cppblog.com/mzty/archive/2005/12/15/1770.html详细解说 STL 排序(Sort)0 前言: STL,为什么你必须掌握1 STL提供的Sort 算法1.1 所有sort算法介绍1.2 sort 中的比较函数1.3 sort 的稳定性1.4 全排序1.5 局部排序1.6 nth_element 指定元素排序1.7 partition 和stable_partition2 Sort 和容器3 选择合适的排序函数4 小结5 参考文档一切复杂的排序操作,都可以通过STL方便实现 阅读全文
posted @ 2012-11-18 13:30 kiwi_bird 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<string.h> 3 #include<queue> 4 #define MOD(x,y) ((x)%(y)+(y))%(y) 5 using namespace std; 6 7 bool hash[1000][2]; 8 struct node 9 { 10 int dist,modk,modm; 11 char opt; 12 }father[1000][2]; 13 int n,k,m,m_k,n_m; 14 15 void print(node cur,int cnt) 16 ... 阅读全文
posted @ 2012-11-13 22:02 kiwi_bird 阅读(488) 评论(0) 推荐(0) 编辑