摘要: 归并排序。以后留着复习数据结构用,看了很多个版本,这个版本写的比较好,我改编了一下。 1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 #define N 1000000 5 int que[N],p[N];; 6 void Mergesort(int l,int r) 7 { 8 int mid,i,j,t; 9 if(l < r)10 {11 mid = (l+r)/2;12 Mergesort(l,mid);13 Mergesort(... 阅读全文
posted @ 2012-09-21 21:42 Naix_x 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题目链接用DFS就可以过,判重的时候用map去重的,因为每一条边是最大是10000,用150000进制的3位数就可以表示出现的状态。数据水了。。。我的代码用的是15000进制就A了。。。卡线过的1300+ms 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 #include <cstdlib> 6 #include <map> 7 using namespace std; 8 int ans,p[16], 阅读全文
posted @ 2012-09-21 14:45 Naix_x 阅读(118) 评论(0) 推荐(0) 编辑