![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
文章平均质量分 72
coder_coder_coder
默默的程序猿
展开
-
hoj1867经理的烦恼
//#include #include #include //树状数组里存的是为素数的店数 //普通数组存原数据 //在店里商品从素数变为非素或非素变为素是树状数组更新 using namespace std; const int MAXN=1000005; int a[MAXN],c[MAXN]; bool p[10000001]; int C,T; void prime(){ p原创 2014-08-08 22:34:50 · 375 阅读 · 0 评论 -
poj3321Apple Tree
#include #include #include using namespace std; const int N=100005; int n,m,s[N<<1],e[N<<1],next[N<<1],c[N],l[N],r[N],cnt; bool vis[N]; //s[]start,e[]end, //cnt表示dfs访问时间,l[]记录进入时,r[]记录出去时 //注意c[i]是原创 2014-08-12 00:39:48 · 402 阅读 · 0 评论 -
hdu3887Counting Offspring
#include #include #include #include using namespace std; const int N=100005; int f[N],c[N<<1],s[N<<1],e[N<<1],next[N<<1],n,p,l[N],r[N]; bool vis[N]; void connect(int i,int u,int v){ next[i]=s[原创 2014-08-12 00:41:51 · 337 阅读 · 0 评论