当前位置: 首页 > news >正文

网站建设公司宣传词wordpress站点搬家

网站建设公司宣传词,wordpress站点搬家,wordpress等待响应,试玩网站开发http://www.zybbs.org/JudgeOnline/problem.php?id2243 题目大意#xff1a;给你一棵树#xff0c;节点有颜色#xff0c;要求可以查询某路径中连续颜色段的数目和修改某一段路径的颜色。 两次拉实之后查询和修改即可。 #include iostream #include cstdio…  http://www.zybbs.org/JudgeOnline/problem.php?id2243   题目大意给你一棵树节点有颜色要求可以查询某路径中连续颜色段的数目和修改某一段路径的颜色。   两次拉实之后查询和修改即可。    #include iostream #include cstdio #include cstring #include cstdlib #include queue #define NIL LCT #define MM 200001 #define MN 100001 using namespace std;queueint q; int n,m,a,b,c,color[MN]; char s[10]; struct EDGE{int pnt;EDGE *pre;EDGE (){}EDGE(int _pnt,EDGE *_pre):pnt(_pnt),pre(_pre){} }Edge[MM],*EPEdge,*edge[MM];inline void addedge(int a,int b){edge[a]new(EP)EDGE(b,edge[a]);edge[b]new(EP)EDGE(a,edge[b]); }struct LinkCutTree{struct NODE{int c,lc,rc,mark,cnt;bool root;NODE *left,*right,*father;NODE (){}NODE(int _c,NODE *_left,NODE *_right,NODE *_father):c(_c),lc(_c),rc(_c),left(_left),right(_right),father(_father){mark0,cnt1,roottrue;}}LCT[MN],*NP,*node[MN];void init(){NPNIL;NIL-cNIL-lcNIL-rcNIL-mark0;NIL-leftNIL-rightNIL-fatherNIL;NIL-rootfalse;}void build(){q.push(1);node[1]new(NP)NODE(color[1],NIL,NIL,NIL);while(!q.empty()){int iq.front();q.pop();for(EDGE *jedge[i];j;jj-pre)if(node[j-pnt]!node[i]-father){node[j-pnt]new(NP)NODE(color[j-pnt],NIL,NIL,node[i]);q.push(j-pnt);}}}void renew(NODE *t,int key){if(t!NIL) t-ct-lct-rct-markkey,t-cnt1;}void pushdown(NODE *t){if(t-mark){renew(t-left,t-mark);renew(t-right,t-mark);t-mark0;}}void update(NODE *t){t-lct-rct-c;if(t-left!NIL) t-lct-left-lc;if(t-right!NIL) t-rct-right-rc;t-cntt-left-cntt-right-cnt1;if(t-ct-left-rc) t-cnt--;if(t-ct-right-lc) t-cnt--;}void zig(NODE *t){NODE *ft-father,*rt-right;pushdown(f);pushdown(t);t-fatherf-father;if(f-root) t-roottrue,f-rootfalse;else{if(f-father-leftf) f-father-leftt;else f-father-rightt;}t-rightf,f-fathert,f-leftr,r-fatherf;update(f);}void zag(NODE *t){NODE *ft-father,*lt-left;pushdown(f);pushdown(t);t-fatherf-father;if(f-root) t-roottrue,f-rootfalse;else{if(f-father-leftf) f-father-leftt;else f-father-rightt;}t-leftf,f-fathert,f-rightl,l-fatherf;update(f);}void splay(NODE *t){pushdown(t);while(!t-root){if(t-father-root){if(t-father-leftt) zig(t);else zag(t);}else{if(t-father-father-leftt-father){if(t-father-leftt) zig(t-father),zig(t);else zag(t),zig(t);}else{if(t-father-leftt) zig(t),zag(t);else zag(t-father),zag(t);}}}update(t);}void Expose(NODE *t){NODE *pt,*qNIL;while(p!NIL){splay(p);p-right-roottrue;p-rightq;p-right-rootfalse;update(p);qp;pp-father;}}void Modify(int a,int b,int c){Expose(node[a]);NODE *pnode[b],*qNIL;while(p!NIL){splay(p);if(p-fatherNIL){p-cc;renew(p-right,c);renew(q,c);}p-right-roottrue;p-rightq;p-right-rootfalse;update(p);qp;pp-father;}}void query(int a,int b){Expose(node[a]);NODE *pnode[b],*qNIL;while(p!NIL){splay(p);if(p-fatherNIL){int ansq-cntp-right-cnt1;if(p-cq-lc) ans--;if(p-cp-right-lc) ans--;printf(%d\n,ans);}p-right-roottrue;p-rightq;p-right-rootfalse;update(p);qp;pp-father;}} }tree;int main(){scanf(%d%d,n,m);for(int i1;in;i) scanf(%d,color[i]);for(int i1;in;i){scanf(%d%d,a,b);addedge(a,b);}tree.init();tree.build();while(m--){scanf(%s,s);if(s[0]Q){scanf(%d%d,a,b);tree.query(a,b);}else{scanf(%d%d%d,a,b,c);tree.Modify(a,b,c);}}return 0; }转载于:https://www.cnblogs.com/Delostik/archive/2011/08/11/2134544.html
http://www.huolong8.cn/news/215228/

相关文章:

  • 推广网站有效的免费方法国外 创意 网站
  • 网页设计与网站建设完全学习手册百度查重软件
  • 网站怎么做本地映射wordpress有什么优缺点
  • 24小时网站开发 pdf动漫制作专业主修课程
  • 蚌埠做网站建设费用战队logo免费自动生成器
  • 快递网站模版公司建网站有免费的吗
  • 报表网站建设自己怎么去做seo网站推广?
  • 海南省交通建设局网站首页怎么推广自己的网站链接
  • 我是做装修什么网站可以网址搜索引擎
  • 做网站优化公司排行网站维护一般做什么
  • 深圳seo整站优化承接赤壁市药监局网站建设方案
  • 北京建网站费用生鲜电商网站建设与管理
  • 电子商务网站建设与管理实验目的wordpress 自定义post
  • 用公司网站后缀做邮箱网站cms管理后台电话号码
  • 房产公司网站建设工作简历怎么写?
  • app 网站国人在线做网站
  • 网站流量是如何计算的专注高端网站建设
  • 海口网站建设在线html网页制作代码大全免费
  • 淄博做网站广州番禺区工商职业技术学校
  • 网站开发浏览器分辨率做网站建设公司crm在线的提升服务
  • 做网页课件的网站品牌公司标志设计制作
  • 哪家手表网站wordpress安装目录权限
  • 三合一网站建设方案网站建设外包工作室
  • 设备租赁网站建设网站建设实战李静
  • 电商网站seo公司网页游戏排行榜前十推荐
  • 网站后台不更新通化网站建设
  • 成都市网站设网站换模板
  • 盘锦建网站国外做图标网站
  • 山东省建设管理局网站嵌入式软件开发流程图
  • 律师网站建设费用网站建设任职