摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=100000+5; 6 int c[maxn]; 7 int ans[maxn]; 8 struct pos 9 {10 int s,e;11 int id;12 bool operator s;15 return a.e0)26 {27 ret+=c[x];28 x-=lowbit(x);29 }30 return ret;31 }32 void ad... 阅读全文
posted @ 2013-08-16 19:23 sooflow 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=15000+5; 6 const int maxd=32000+5; 7 int c[maxd]; 8 int ans[maxn]; 9 int lowbit(int x)10 {11 return x&-x;12 }13 int sum(int x)14 {15 int ret=0;16 while(x>0)17 {18 ret+=c[x];19 x-=lowbit(x);20 ... 阅读全文
posted @ 2013-08-16 19:22 sooflow 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=100000+5; 6 struct edge 7 { 8 int v; 9 edge *next; 10 }; 11 edge *g[maxn]; 12 edge mall[2*maxn]; 13 edge *tmp; 14 int c[maxn]; 15 int s[maxn]; 16 int e[maxn]; 17 int vis[maxn]; 18 int cnt; 19 int n; 20 int top... 阅读全文
posted @ 2013-08-16 19:21 sooflow 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=1000010+5; 6 int c[maxn]; 7 int n,m,k; 8 struct pos 9 {10 int e,w;11 bool operator a.e;14 return w>a.w;15 }16 }p[maxn];17 int lowbit(int x)18 {19 return x&-x;20 }21 int sum(int x)22 {23 int ret=0;24 ... 阅读全文
posted @ 2013-08-16 19:20 sooflow 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 const int maxn=1024+5; 4 int s[maxn][maxn]; 5 int n; 6 int lowbit(int x) 7 { 8 return x&-x; 9 }10 long long sum(int x,int y)11 {12 long long ret=0;13 for(int i=x;i>0;i-=lowbit(i))14 for(int j=y;j>0;j-=lowbit(j))15 ret+=s[i][j];16 return ret;1... 阅读全文
posted @ 2013-08-16 19:19 sooflow 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 const int maxn=1000+5; 4 int n,m; 5 int s[maxn][maxn]; 6 int lowbit(int x) 7 { 8 return x&-x; 9 }10 int sum(int x,int y)11 {12 int ret=0;13 for(int i=x;i>0;i-=lowbit(i))14 for(int j=y;j>0;j-=lowbit(j))15 ret+=s[i][j];16 return ret;17 }18 voi... 阅读全文
posted @ 2013-08-16 19:15 sooflow 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=20000+5; 6 int dis[maxn]; 7 int num[maxn]; 8 int n; 9 struct COW10 {11 int vol,x;12 bool operator 0)25 {26 ret+=c[x];27 x-=lowbit(x);28 }29 return ret;30 }31 void add(int *c,int x,int inc,in... 阅读全文
posted @ 2013-08-16 19:13 sooflow 阅读(170) 评论(0) 推荐(0) 编辑