Qiuqiqiu  
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步!

2012年5月8日

摘要: 树状数组View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 6 typedef __int64 LL; 7 const int N=100010; 8 struct node 9 {10 int nx,nh,x,h;11 bool operator < (const node &a)const12 {13 return nh<a.nh;14 }15 }a[N];16 LL c1[N];17 in 阅读全文
posted @ 2012-05-08 19:09 Qiuqiqiu 阅读(288) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3486RMQ知道二分是错的,写了个加简单优化的枚举还是超时,只能用错误的二分做这题主要为了学习RMQ,别的细节就不管了View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 6 const int N=200010, A=1001; 7 int a[N]; 8 int n,k; 9 int st[N][20],lg2[N];10 vo 阅读全文
posted @ 2012-05-08 17:05 Qiuqiqiu 阅读(450) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2874LCA Tarjan算法#include <cstdio>#include <cstring>#include <vector>using namespace std;const int N=10010,M=20010;struct edge{ int v,w,next;}e[M];int em;int head[N],n;struct qes{ int v,k;};vector<qes> q[N];int dis[N],vis[N],set[N],anc 阅读全文
posted @ 2012-05-08 09:50 Qiuqiqiu 阅读(318) 评论(0) 推荐(0) 编辑