2012年6月17日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 typedef __int64 LL; 5 using namespace std; 6 #define MAXN 1010 7 struct Point 8 { 9 int x,y,z; 10 void Input() 11 { 12 scanf("%d%d%d",&x,&y,&z); 13 } 14 }; 15 struct Rectangle 16 { 17 Point a,b; 18 阅读全文
posted @ 2012-06-17 14:18 DrunBee 阅读(425) 评论(0) 推荐(0) 编辑
  2012年6月16日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define MAXN 20010 5 typedef __int64 LL; 6 using namespace std; 7 struct Seg 8 { 9 LL left,right,val,high;10 friend bool operator<(Seg a,Seg b)11 {12 if(a.high!=b.high)13 return a.high<b.high;14 r... 阅读全文
posted @ 2012-06-16 10:37 DrunBee 阅读(337) 评论(0) 推荐(0) 编辑
  2012年6月9日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #include<cmath> 5 #include<algorithm> 6 #define MAXN 5010 7 #define EPS 1e-8 8 using namespace std; 9 struct Line 10 { 11 double left,right,high; 12 int flag; 13 }; 14 struct node 15 { 16 int cover; 17 double 阅读全文
posted @ 2012-06-09 20:57 DrunBee 阅读(260) 评论(0) 推荐(0) 编辑
  2012年6月8日
摘要: 1 #include<cstdio> 2 #define MAXN 500010 3 int tree[MAXN<<2]; 4 inline void PushUp(int rt) 5 { 6 tree[rt]=tree[rt<<1]+tree[rt<<1|1]; 7 } 8 void Build(int L,int R,int rt) 9 {10 if(L==R)11 tree[rt]=1;12 else13 {14 int mid=(L+R)>>1;15 Build(L,mid,rt<<1);16 ... 阅读全文
posted @ 2012-06-08 00:15 DrunBee 阅读(506) 评论(0) 推荐(0) 编辑
  2012年6月7日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #include<algorithm> 5 #define MAXN 20010 6 #define INF 123456789 7 using namespace std; 8 struct Line 9 {10 int left,right,high,flag;11 };12 Line p[MAXN];13 struct node14 {15 int sum,cnt,left,right,vertical;16 }tree 阅读全文
posted @ 2012-06-07 16:36 DrunBee 阅读(359) 评论(0) 推荐(0) 编辑
  2012年6月2日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define MAXN 2010 5 using namespace std; 6 struct Line 7 { 8 int left,right,color; 9 }; 10 Line p[MAXN]; 11 int x[MAXN<<2],tree[MAXN<<4]; 12 bool vis[MAXN<<2]; 13 inline void PushDown(int rt) 14 { 15 i 阅读全文
posted @ 2012-06-02 21:07 DrunBee 阅读(650) 评论(1) 推荐(1) 编辑
  2012年6月1日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #define MAXN 100010 5 struct Line 6 { 7 int left,right,high,flag; 8 }; 9 struct node 10 { 11 int sum,cover; 12 }; 13 Line p[MAXN]; 14 node tree[MAXN<<2]; 15 int x[MAXN]; 16 inline bool Out(int x1,int y1,int x2,int y 阅读全文
posted @ 2012-06-01 21:29 DrunBee 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cmath> 3 typedef __int64 LL; 4 #define EPS 1e-9 5 #define MAXN 100010 6 struct node 7 { 8 LL sum; 9 int flag;10 };11 node tree[MAXN<<2];12 inline void PushUp(int rt)13 {14 tree[rt].flag=tree[rt<<1].flag&tree[rt<<1|1].flag;15 tree[rt].su 阅读全文
posted @ 2012-06-01 12:25 DrunBee 阅读(350) 评论(0) 推荐(1) 编辑
  2012年5月31日
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #define MAXN 50010 5 typedef __int64 LL; 6 struct Line 7 { 8 int left,right,high,flag; 9 }; 10 struct node 11 { 12 int cover,len; 13 }; 14 Line p[MAXN<<3]; 15 node tree[MAXN<<5]; 16 int cnt,x[MAXN<<3]; 1 阅读全文
posted @ 2012-05-31 23:20 DrunBee 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #include<cmath> 5 #define EPS 1e-9 6 #define MAXN 210 7 struct Line 8 { 9 double left,right,high; 10 int flag; 11 }; 12 struct node 13 { 14 int cover; 15 double len; 16 }; 17 node tree[MAXN<<2]; 18 Line p[MAXN 阅读全文
posted @ 2012-05-31 16:38 DrunBee 阅读(454) 评论(0) 推荐(1) 编辑