- 博客(4)
- 资源 (2)
- 收藏
- 关注
原创 poj 487-3279 (方便记忆的电话号码)
渣扎一枚……hiahia不过,能ac的代码都是好代码(考试而言)#include #include #include #include #include #include #include using namespace std;typedef pair psi;int Map[30] = {2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,0,7,7,8,
2013-11-26 14:04:55 1131
原创 poj 求逆序对数
核心思想当然是在归并排序的过程中完成逆序对数的计算咯……很好懂吧看看代码就知道具体过程了嗯:#include #include #include using namespace std;#define MAXSIZE 20010int A[MAXSIZE]; int N;int cnt;void merge_sort(int front,int rear) { if (re
2013-11-23 21:26:34 1043
原创 poj 拓扑排序
#include #include #include #include #include using namespace std;#define MAXSIZE 1000int G[MAXSIZE][MAXSIZE];int in[MAXSIZE];int vist[MAXSIZE];int e_num,v_num;priority_queue,greater > q;in
2013-11-19 23:54:32 981
原创 poj 宝昌县长要修路(Kruskal最小生成树)
主要就是并查集(路径压缩)以及用间接排序的使用,练练手而已。时候不早了,碎觉去~~~~#include #include #include #include using namespace std;#define MAXSIZE 100struct EDGE { int w; int u; int v; void make(int start, int dest, int dist
2013-11-19 23:34:38 2128
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人