摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4604这个题解有点问题,暂时没时间改,还是参考别人的吧#include #include #include #include #include #include #include #define maxn 100500using namespace std;const int INF = 0x3f3f3f;int a[maxn];int s1[maxn],s2[maxn];int ans;int n;int search_lower_bound(int l,int h,int m){ if(l... 阅读全文
posted @ 2013-07-23 22:07 等待最好的两个人 阅读(478) 评论(6) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3903 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 100005 9 using namespace std;10 11 int stack[maxn];12 int a[maxn];13 int n;14 15 int search_lower_bound(int l,int h,int m){16 if(l == h) return h;17 int mid ... 阅读全文
posted @ 2013-07-23 22:02 等待最好的两个人 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3659 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 const int maxn = 200005; 9 int p[maxn],num[maxn];10 long long int sum[maxn];11 struct Edge{12 int u,v,c;13 bool operator rh.c;15 }16 ... 阅读全文
posted @ 2013-07-22 21:51 等待最好的两个人 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3367 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 const int maxn = 10005; 9 const int maxm = 100050;10 11 struct Edge{12 int u,v,c;13 bool operator rh.c;15 }16 };17 vector e;18 int p[maxn];19 int n,m; 2... 阅读全文
posted @ 2013-07-22 20:21 等待最好的两个人 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.bupt.edu.cn/onlinejudge/newoj/showProblem/show_problem.php?problem_id=1578 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 using namespace std;11 int a,b;12 int calculatenum(int num){13 int ans = 0;14 while(num>0){15 ... 阅读全文
posted @ 2013-07-12 23:31 等待最好的两个人 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 二分匹配 :http://www.byvoid.com/blog/hungary/zh-hans/很详细,图很多,容易理解矩阵乘法:http://www.matrix67.com/blog/archives/276/经典运用,出自Matrix67大牛之手 阅读全文
posted @ 2013-07-10 20:13 等待最好的两个人 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #define maxn 105012 #define maxk 900013 using namespace std;14 15 int n,k;16 long long int size[maxn];17 bitset mask; //用来记录最后出现搜索的tags的编号;18 map > mmap;19 map >::iterator ... 阅读全文
posted @ 2013-07-10 12:18 等待最好的两个人 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 10005 9 #define L -110 #define R 111 #define fell 1012 #define Turning -1013 #define On 0;14 15 using namespace std;16 struct ants{17 int location;18 int direction;19 int inputorder;20 ... 阅读全文
posted @ 2013-07-09 20:27 等待最好的两个人 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 分析看这个大神的,我的还是参考他说的算法实现的:http://www.dxmtb.com/blog/diff/ 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #include<algorithm> 5 using namespace std; 6 const int maxm = 1000005; 7 const int maxn = 50005; 8 9 10 int C[maxn],next[maxn],B[maxn];11 int flag[maxm];12 st 阅读全文
posted @ 2013-06-03 18:31 等待最好的两个人 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166;树状数组: 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #include<algorithm> 5 using namespace std; 6 7 const int maxn = 50050; 8 int n,T; 9 int a[maxn];10 int C[maxn];11 int lowbit(int x){12 return x&(-x);13 阅读全文
posted @ 2013-06-02 22:59 等待最好的两个人 阅读(140) 评论(0) 推荐(0) 编辑