2012年6月27日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 typedef __int64 LL; 6 #define MAXN 30010 7 #define MAXM 100010 8 int a[MAXN],b[MAXN],vis[MAXN]; 9 LL ans[MAXM],tree[MAXN<<2];10 struct node11 {12 int left,right,pos;13 friend bool operator&l 阅读全文
posted @ 2012-06-27 11:14 DrunBee 阅读(254) 评论(0) 推荐(0) 编辑
  2012年6月26日
摘要: 1 #include<cstdio> 2 #define MAXN 10010 3 #define MAXM 11 4 #define INF 2147483647 5 int n,k,need[MAXM]; 6 struct node 7 { 8 int big,lazy; 9 }; 10 node tree[MAXM][MAXN<<2]; 11 inline int MAX(int x,int y) 12 { 13 return x>y?x:y; 14 } 15 inline void PushUp(int t,int rt) 16 { 17 t... 阅读全文
posted @ 2012-06-26 13:16 DrunBee 阅读(411) 评论(0) 推荐(0) 编辑
  2012年6月24日
摘要: 1 #include<cstdio> 2 #include<algorithm> 3 typedef long long LL; 4 #define MAXN 30010 5 using namespace std; 6 int n,k; 7 struct Seg 8 { 9 int left,right,high,flag; 10 friend bool operator<(Seg a,Seg b) 11 { 12 if(a.high==b.high) 13 return a.flag<b.flag; 14 ... 阅读全文
posted @ 2012-06-24 10:08 DrunBee 阅读(447) 评论(0) 推荐(0) 编辑
  2012年6月22日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 #define MAXN 50010 6 struct node 7 { 8 int left,right,sum,lazy,s,e,cnt,cover; 9 }; 10 node tree[MAXN<<2]; 11 inline void PushUp(int mid,int L,int R,int rt) 12 { 13 tree[rt].left=tree[rt<& 阅读全文
posted @ 2012-06-22 16:05 DrunBee 阅读(697) 评论(0) 推荐(0) 编辑
  2012年6月21日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 #define MAXN 50010 6 struct time 7 { 8 int s,t,ef; 9 friend bool operator<(time a,time b)10 {11 return a.ef>b.ef;12 }13 };14 struct node15 {16 int sum,lazy;17 };18 time p[MAXN*10];19 no... 阅读全文
posted @ 2012-06-21 13:55 DrunBee 阅读(463) 评论(1) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define MAXN 500010 5 using namespace std; 6 int x[MAXN]; 7 bool vis[MAXN]; 8 struct cmd 9 { 10 char s[6]; 11 int val; 12 }; 13 struct node 14 { 15 int left,right,val; 16 }; 17 node tree[MAXN<<2]; 18 cmd p[MAXN]; 阅读全文
posted @ 2012-06-21 13:24 DrunBee 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 #define MAXN 10010 5 int tree[MAXN<<2],ca=1; 6 inline void PushUp(int rt) 7 { 8 tree[rt]=min(tree[rt<<1],tree[rt<<1|1]); 9 }10 void Build(int L,int R,int rt)11 {12 if(L==R)13 scanf("%d",&tre 阅读全文
posted @ 2012-06-21 11:02 DrunBee 阅读(334) 评论(1) 推荐(0) 编辑
  2012年6月18日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<vector> 4 #include<algorithm> 5 #include<set> 6 using namespace std; 7 #define MAXN 16010 8 #define INF 123456789 9 struct Seg 10 { 11 int y1,y2,x; 12 friend bool operator<(Seg a,Seg b) 13 { 14 return a.x<b.x; 15 } 阅读全文
posted @ 2012-06-18 21:58 DrunBee 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #define MAXN 500010 3 int n,k,ans,cnt; 4 int prime[]={2,3,5,7,11,13,17}; 5 struct node 6 { 7 char name[12]; 8 int val; 9 }; 10 node p[MAXN]; 11 int tree[MAXN<<2]; 12 void AntiPrime(int res,int count,int index,int limit) 13 { 14 if(res<=n) 15 { 16 ... 阅读全文
posted @ 2012-06-18 11:48 DrunBee 阅读(431) 评论(0) 推荐(0) 编辑
  2012年6月17日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 typedef __int64 LL; 5 #define MAXN 30010 6 using namespace std; 7 struct Plant 8 { 9 int x1,y1,x2,y2,s; 10 }; 11 struct Seg 12 { 13 int left,right,high,flag; 14 friend bool operator<(Seg a,Seg b) 15 { 16 ... 阅读全文
posted @ 2012-06-17 16:29 DrunBee 阅读(194) 评论(0) 推荐(0) 编辑