{"id":275,"date":"2012-11-20T08:43:00","date_gmt":"2012-11-20T00:43:00","guid":{"rendered":"http:\/\/nike0good.jp1.rpvhost.net\/180"},"modified":"2012-11-20T08:43:00","modified_gmt":"2012-11-20T00:43:00","slug":"cf_242e_the_zkw_segment_tree_-_demolition_bit","status":"publish","type":"post","link":"https:\/\/nike0good.com\/?p=275","title":{"rendered":"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09"},"content":{"rendered":"<div style=\"margin:0px; padding:0px; position:relative; font-size:14px; font-family:verdana,arial,sans-serif\">\n<div id=\"content\" class=\"content-with-sidebar\" style=\"margin:1em; padding:1em 0px 0px; min-height:20em\">\n<div class=\"ttypography\" style=\"margin:0px; padding:0px; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; line-height:21px; color:rgb(34,34,34); word-wrap:break-word\">\n<div class=\"problem-statement\" style=\"margin:0.5em; padding:0px; line-height:1.5em\">\n<div class=\"header\" style=\"margin:0px 0px 1em; padding:0px; text-align:center\">\n<div class=\"title\" style=\"margin:0px 0px 0.5em; padding:0px; font-size:21px\">E. XOR on Segment<\/div>\n<div class=\"time-limit\" style=\"margin:0px auto; padding:0px\">\n<div class=\"property-title\" style=\"margin:0px; padding:0px 4px 0px 0px; display:inline\">\ntime limit per test<\/div>\n<p>4 seconds<\/p><\/div>\n<div class=\"memory-limit\" style=\"margin:0px auto; padding:0px\">\n<div class=\"property-title\" style=\"margin:0px; padding:0px 4px 0px 0px; display:inline\">\nmemory limit per test<\/div>\n<p>256 megabytes<\/p><\/div>\n<div class=\"input-file\" style=\"margin:0px auto; padding:0px\">\n<div class=\"property-title\" style=\"margin:0px; padding:0px 4px 0px 0px; display:inline\">\ninput<\/div>\n<p>standard input<\/p><\/div>\n<div class=\"output-file\" style=\"margin:0px auto; padding:0px\">\n<div class=\"property-title\" style=\"margin:0px; padding:0px 4px 0px 0px; display:inline\">\noutput<\/div>\n<p>standard output<\/p><\/div>\n<\/div>\n<div style=\"margin:0px; padding:0px\">\n<p style=\"margin-top:1.5em; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:1em; line-height:1.5em\">\n\u5bf9\u4e8e\u6570\u7ec4\uff0c<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\"><em>a<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\">1<\/sub>,\u2009<em>a<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\">2<\/sub>,\u2009...,\u2009<em>a<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>n<\/em><\/sub><\/span>.<br \/>\n \u8bf7\u7ef4\u62a42\u4e2a\u64cd\u4f5c\u3002<\/p>\n<p style=\"margin-top:1.5em; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:1em; line-height:1.5em\">\n<ol style=\"margin:0.5em 0px 0px 1em; padding:0px; list-style-position:outside; font-size:1em; line-height:1.5em\">\n<li style=\"margin:0px 0px 0px 0.8em; padding:0px; line-height:1.5em; font-size:1em\">\n\u533a\u95f4<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">[<em>l<\/em>,\u2009<em>r<\/em>]<\/span>, \u6c42\u548c.<\/li>\n<li style=\"margin:0px 0px 0px 0.8em; padding:0px; line-height:1.5em; font-size:1em\">\n\u5c06\u533a\u95f4&nbsp;<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">[<em>l<\/em>,\u2009<em>r<\/em>]<\/span>,\u4e0a\u7684\u6570\u5f02\u6216x<\/li>\n<\/ol>\n<\/div>\n<div class=\"input-specification\" style=\"margin:0px; padding:0px\">\n<div class=\"section-title\" style=\"margin:0px; padding:0px; font-size:16px; font-weight:bold\">\nInput<\/div>\n<p style=\"margin-top:1.5em; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:1em; line-height:1.5em\">\n\u7b2c\u4e00\u884c\u4e3a\u6570\u7ec4\u5927\u5c0f&nbsp;<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\"><em>n<\/em><\/span>&nbsp;(<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">1\u2009\u2264\u2009<em>n<\/em>\u2009\u2264\u200910<sup class=\"upper-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; top:-0.5em\">5<\/sup><\/span>),&nbsp;<span style=\"color:rgb(34,34,34); font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:14px; line-height:21px\">\u7b2c\u4e8c\u884c\u4e3a\u6570\u7ec4<\/span>&nbsp;<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\"><em>a<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\">1<\/sub>,\u2009<em>a<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\">2<\/sub>,\u2009...,\u2009<em>a<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>n<\/em><\/sub><\/span>(<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">0\u2009\u2264\u2009<em>a<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>\u2009\u2264\u200910<sup class=\"upper-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; top:-0.5em\">6<\/sup><\/span>)&nbsp;<\/p>\n<p style=\"margin-top:1.5em; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:1em; line-height:1.5em\">\n\u7b2c\u4e09\u884c\u4e3a\u64cd\u4f5c\u6570&nbsp;<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\"><em>m<\/em><\/span>&nbsp;(<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">1\u2009\u2264\u2009<em>m<\/em>\u2009\u2264\u20095\u00b710<sup class=\"upper-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; top:-0.5em\">4<\/sup><\/span>),\u63a5\u4e0b\u6765\u6bcf\u884c\u7b2c1\u4e2a\u6570<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\"><em>t<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub><\/span>&nbsp;(<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">1\u2009\u2264\u2009<em>t<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>\u2009\u2264\u20092<\/span>)<br \/>\n \u8868\u793a\u8fdb\u884c\u7b2ci\u79cd\u64cd\u4f5c. \u20181 <span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\"><br \/>\n<em>l<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>,\u2009<em>r<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub><\/span>&nbsp;\u2018(<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">1\u2009\u2264\u2009<em>l<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>\u2009\u2264\u2009<em>r<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>\u2009\u2264\u2009<em>n<\/em><\/span>)\u8868\u793a[l,r]\u6c42\u548c.\u20182&nbsp;<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\"><em>l<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>,\u2009<em>r<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>,\u2009<em>x<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub><\/span>&nbsp;(<span class=\"tex-span\" style=\"font-size:18px; font-family:'times new roman',sans-serif\">1\u2009\u2264\u2009<em>l<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>\u2009\u2264\u2009<em>r<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>\u2009\u2264\u2009<em>n<\/em>,\u20091\u2009\u2264\u2009<em>x<\/em><sub class=\"lower-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; bottom:-0.25em\"><em>i<\/em><\/sub>\u2009\u2264\u200910<sup class=\"upper-index\" style=\"font-size:13px; line-height:0; position:relative; vertical-align:baseline; top:-0.5em\">6<\/sup><\/span>)\u8868\u793a<span style=\"color:rgb(34,34,34); font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:14px; line-height:21px\">\u5c06\u533a\u95f4&nbsp;<\/span><span class=\"tex-span\" style=\"color:rgb(34,34,34); line-height:21px; font-size:18px; font-family:'times new roman',sans-serif\">[<em>l<\/em>,\u2009<em>r<\/em>]<\/span><span style=\"color:rgb(34,34,34); font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:14px; line-height:21px\">,\u4e0a\u7684\u6570\u5f02\u6216x<\/span><\/p>\n<\/div>\n<div class=\"output-specification\" style=\"margin:0px 0px 1em; padding:0px\">\n<div class=\"section-title\" style=\"margin:0px; padding:0px; font-size:16px; font-weight:bold\">\nOutput<\/div>\n<p style=\"margin-top:1.5em; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:1em; line-height:1.5em\">\n\u8f93\u51fa\u6240\u6709\u64cd\u4f5c1\u7684\u7ed3\u679c\u3002<\/p>\n<p style=\"margin-top:1.5em; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:1em; line-height:1.5em\">\n\u4e0d\u8981\u7528<span class=\"tex-font-style-tt\" style=\"font-size:15px; font-family:'courier new',monospace\">%lld<\/span>&nbsp;\u5360\u4f4d\u7b26\uff0c\u6539\u7528\u8f93\u5165\u8f93\u51fa\u6d41\u6216<span class=\"tex-font-style-tt\" style=\"font-size:15px; font-family:'courier new',monospace\">%I64\u5360\u4f4d\u7b26<\/span>.<\/p>\n<\/div>\n<div class=\"sample-tests\" style=\"margin:0px; padding:0px; font-family:Consolas,'Lucida Console','Andale Mono','Bitstream Vera Sans Mono','Courier New',Courier; font-size:0.9em\">\n<div class=\"section-title\" style=\"margin:0px; padding:0px; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:14px; font-weight:bold\">\nSample test(s)<\/div>\n<div class=\"sample-test\" style=\"margin:0px; padding:0px\">\n<div class=\"input\" style=\"margin:0px; padding:0px; border:1px solid rgb(136,136,136)\">\n<div class=\"title\" style=\"margin:0px; padding:0.25em; font-size:1.3em; border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:rgb(136,136,136); text-transform:lowercase; font-weight:bold\">\ninput<\/div>\n<pre style=\"margin-top:0px; margin-bottom:0px; padding:0.25em; font-family:Consolas,'Lucida Console','Andale Mono','Bitstream Vera Sans Mono','Courier New',Courier; line-height:1.25em; white-space:pre-wrap; word-wrap:break-word; color:rgb(136,0,0); background-color:rgb(239,239,239)\">5\n4 10 3 13 7\n8\n1 2 4\n2 1 3 3\n1 2 4\n1 3 3\n2 2 5 5\n1 1 5\n2 1 2 10\n1 2 3\n<\/pre>\n<\/div>\n<div class=\"output\" style=\"margin:0px 0px 1em; padding:0px; border:1px solid rgb(136,136,136); position:relative; top:-1px\">\n<div class=\"title\" style=\"margin:0px; padding:0.25em; font-size:1.3em; border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:rgb(136,136,136); text-transform:lowercase; font-weight:bold\">\noutput<\/div>\n<pre style=\"margin-top:0px; margin-bottom:0px; padding:0.25em; font-family:Consolas,'Lucida Console','Andale Mono','Bitstream Vera Sans Mono','Courier New',Courier; line-height:1.25em; white-space:pre-wrap; word-wrap:break-word; color:rgb(136,0,0); background-color:rgb(239,239,239)\">26\n22\n0\n34\n11\n<\/pre>\n<\/div>\n<div class=\"input\" style=\"margin:0px; padding:0px; border:1px solid rgb(136,136,136)\">\n<div class=\"title\" style=\"margin:0px; padding:0.25em; font-size:1.3em; border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:rgb(136,136,136); text-transform:lowercase; font-weight:bold\">\ninput<\/div>\n<pre style=\"margin-top:0px; margin-bottom:0px; padding:0.25em; font-family:Consolas,'Lucida Console','Andale Mono','Bitstream Vera Sans Mono','Courier New',Courier; line-height:1.25em; white-space:pre-wrap; word-wrap:break-word; color:rgb(136,0,0); background-color:rgb(239,239,239)\">6\n4 7 4 0 7 3\n5\n2 2 3 8\n1 1 5\n2 3 5 1\n2 4 5 6\n1 2 3\n<\/pre>\n<\/div>\n<div class=\"output\" style=\"margin:0px 0px 1em; padding:0px; border:1px solid rgb(136,136,136); position:relative; top:-1px\">\n<div class=\"title\" style=\"margin:0px; padding:0.25em; font-size:1.3em; border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:rgb(136,136,136); text-transform:lowercase; font-weight:bold\">\noutput<\/div>\n<pre style=\"margin-top:0px; margin-bottom:0px; padding:0.25em; font-family:Consolas,'Lucida Console','Andale Mono','Bitstream Vera Sans Mono','Courier New',Courier; line-height:1.25em; white-space:pre-wrap; word-wrap:break-word; color:rgb(136,0,0); background-color:rgb(239,239,239)\">38\n28<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><span style=\"font-size:14px\">\u8fd9\u9898\u662fxor\u62c6\u4f4d\u6cd5\u7684\u8fd0\u7528<\/span><\/p>\n<p><span style=\"font-size:14px\">\u663e\u7136\u6211\u4eec\u53ef\u4ee5\u7528t[i,j]\u8868\u793a\u7b2ci\u4f4d\u4e0a\u76841\u7684\u4e2a\u6570\uff0c\u4e4b\u540e\u6c42\u548c\u7edf\u8ba1\uff08\u8fd9\u662fxor\u64cd\u4f5c\u4f18\u5316\u7684\u5e38\u7528\u624b\u6bb5\uff09<\/span><\/p>\n<p><span style=\"font-size:14px\">zkw\u7ebf\u6bb5\u6811\u52a0Lazy\u6807\u8bb0\u65f6\uff0c\u7528tot[]\u8868\u793a\u533a\u95f4\u4e0a\u7684\u603b\u6570(\u5176\u5b9e\u4e5f\u53ef\u4ee5\u65f6\u4e8b\u7b97\u51fa\u6765\uff09<\/span><\/p>\n<p><span style=\"font-size:14px\"><br \/>\n<\/span><\/p>\n<\/p>\n<pre name=\"code\" class=\"cpp\">#include&lt;cstdio&gt;\n#include&lt;cstring&gt;\n#include&lt;cstdlib&gt;\n#include&lt;cmath&gt;\n#include&lt;cctype&gt;\n#include&lt;iostream&gt;\nusing namespace std;\n#define MAXN (100000+10)\n#define MAXAi (1000000+10)\n#define LogMAXAi (20)\n#define MAXm (50000)\n#define NDEBUG\nint n,m,M,t[LogMAXAi+10][MAXN*10],tot[MAXN*10]={0};\nbool b[LogMAXAi+10][MAXN*10]={0};\nvoid build_tree()\n{\n\tfor (int i=M+1;i&lt;=M+n;i++) tot[i]=1;\n\tfor (int i=M-1;i&gt;=1;i--) tot[i]=tot[i&lt;&lt;1]+tot[(i&lt;&lt;1)^1];\n\n}\nlong long count_a_tree_node(int x)\n{\n\tlong long ans=0;\n\tfor (int i=0,p=1;i&lt;20;i++,p&lt;&lt;=1) ans+=(long long)(p)*(long long)(t[i][x]);\n\treturn ans;\n}\nlong long quere(int l,int r)\n{\n\tlong long ans=0;\n\tl--;r++;\n\tl+=M;r+=M;\n\twhile (l^r^1)\n\t{\n\t\tif (~l&amp;1) ans+=count_a_tree_node(l+1);\n\t\tif (r&amp;1) ans+=count_a_tree_node(r-1);\n\t\tl&gt;&gt;=1;r&gt;&gt;=1;\n\t}\n\treturn ans;\n}\nvoid pushdown(int x)\n{\n\tif (x!=1) pushdown(x&gt;&gt;1);\n\tfor (int i=0;i&lt;20;i++)\n\t{\n\t\tif (b[i][x])\n\t\t{\n\t\t\tt[i][x&lt;&lt;1]=tot[x&lt;&lt;1]-t[i][x&lt;&lt;1];\n\t\t\tt[i][(x&lt;&lt;1)^1]=tot[(x&lt;&lt;1)^1]-t[i][(x&lt;&lt;1)^1];\n\t\t\tb[i][x]=0;b[i][x&lt;&lt;1]^=1;b[i][(x&lt;&lt;1)^1]^=1;\n\t\t}\n\t}\n}\nvoid update(int x)\n{\n\tfor (int i=0;i&lt;20;i++)\n\t{\n\t\tint xx=x;\n\t\tfor (x&gt;&gt;=1;x;x&gt;&gt;=1)\n\t\t\tt[i][x]=t[i][x&lt;&lt;1]+t[i][(x&lt;&lt;1)^1];\n\t\tx=xx;\n\t}\n}\nvoid a_t_xor(int j,int l,int r)\n{\n\tl--;r++;\n\tl+=M;r+=M;\n\twhile (l^r^1)\n\t{\n\t\tif (~l&amp;1) {t[j][l+1]=tot[l+1]-t[j][l+1];b[j][l+1]^=1;\t}\n\t\tif (r&amp;1) {t[j][r-1]=tot[r-1]-t[j][r-1];b[j][r-1]^=1;\t}\n\t\tl&gt;&gt;=1;r&gt;&gt;=1;\n\t}\n}\nvoid t_xor(int l,int r,int x)\n{\n\tfor (int i=0;x;i++,x&gt;&gt;=1) {if (x&amp;1) a_t_xor(i,l,r);\t}\n}\nint main()\n{\n\/\/\tfreopen(&quot;CF_242E.in&quot;,&quot;r&quot;,stdin);\n\tmemset(t,0,sizeof(t));\n\tscanf(&quot;%d&quot;,&amp;n);\n\tM=1;while (M-2&lt;n) M&lt;&lt;=1; \/\/cout&lt;&lt;M&lt;&lt;endl;\n\tfor (int i=M+1;i&lt;=M+n;i++)\n\t{\n\t\tscanf(&quot;%d&quot;,&amp;t[0][i]);\n\t\tint j=0;\n\t\twhile (t[j][i]) {t[j+1][i]=t[j][i]\/2;t[j][i]&amp;=1;j++;}\n\t}\n\tfor (int j=0;j&lt;=19;j++)\n\t{\n\t\tfor (int i=M-1;i&gt;=1;i--) t[j][i]=t[j][i&lt;&lt;1]+t[j][(i&lt;&lt;1)^1];\n\t}\n\t#ifndef NDEBUG\n\tfor (int i=1;i&lt;=M+n;i++)\n\t{\n\t\tfor (int j=0;j&lt;=19;j++) cout&lt;&lt;t[j][i]&lt;&lt;' ';\n\t\tcout&lt;&lt;endl;\n\t}\n\t#endif\n\tbuild_tree();\n\t\/*\n\tfor (int i=1;i&lt;=M+n;i++) cout&lt;&lt;tot[i]&lt;&lt;' ';\n\tcout&lt;&lt;endl;\n\t*\/\n\tscanf(&quot;%d&quot;,&amp;m);\n\twhile (m)\n\t{\n\t\tint p;\n\t\tscanf(&quot;%d&quot;,&amp;p);\n\t\tif (p==1)\n\t\t{\n\t\t\tint l,r;scanf(&quot;%d%d&quot;,&amp;l,&amp;r);\n\t\t\tpushdown(l-1+M);pushdown(r+1+M);\n\t\t\tcout&lt;&lt;quere(l,r)&lt;&lt;endl;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint l,r,x;\n\t\t\tscanf(&quot;%d%d%d&quot;,&amp;l,&amp;r,&amp;x);\n\t\t\tpushdown(l-1+M);pushdown(r+1+M);\n\t\t\tt_xor(l,r,x);\n\t\t\tupdate(l-1+M);update(r+1+M);\n\t\t}\n\n\t\t#ifndef\tNDEBUG\n\t\tfor (int i=1;i&lt;=M+n;i++)\n\t\t{\n\t\t\tfor (int j=0;j&lt;=19;j++) cout&lt;&lt;t[j][i]&lt;&lt;' ';\n\t\t\tcout&lt;&lt;endl;\n\t\t}\n\t\t#endif\n\t\tm--;\n\t}\n\treturn 0;\n}<\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>E. XOR on Segment time limit per test 4 seconds memory  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[3],"tags":[52,56],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-defaultcategory","tag-the_zkw_segment_tree","tag-bit_computing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09 - nike0good<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nike0good.com\/?p=275\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09 - nike0good\" \/>\n<meta property=\"og:description\" content=\"E. XOR on Segment time limit per test 4 seconds memory [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nike0good.com\/?p=275\" \/>\n<meta property=\"og:site_name\" content=\"nike0good\" \/>\n<meta property=\"article:published_time\" content=\"2012-11-20T00:43:00+00:00\" \/>\n<meta name=\"author\" content=\"nike0good\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"nike0good\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=275#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=275\"},\"author\":{\"name\":\"nike0good\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/#\\\/schema\\\/person\\\/4defa38da89de87e400861e73396baad\"},\"headline\":\"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09\",\"datePublished\":\"2012-11-20T00:43:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=275\"},\"wordCount\":109,\"commentCount\":0,\"keywords\":[\"zkw\u7ebf\u6bb5\u6811\",\"\u4f4d\u8fd0\u7b97\"],\"articleSection\":[\"DefaultCategory\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nike0good.com\\\/?p=275#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=275\",\"url\":\"https:\\\/\\\/nike0good.com\\\/?p=275\",\"name\":\"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09 - nike0good\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/#website\"},\"datePublished\":\"2012-11-20T00:43:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/#\\\/schema\\\/person\\\/4defa38da89de87e400861e73396baad\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=275#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nike0good.com\\\/?p=275\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/?p=275#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nike0good.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/#website\",\"url\":\"https:\\\/\\\/nike0good.com\\\/\",\"name\":\"nike0good\",\"description\":\"\u6709\u6240\u4f5c\u4e3a\u662f\u4eba\u751f\u7684\u6700\u9ad8\u5883\u754c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nike0good.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nike0good.com\\\/#\\\/schema\\\/person\\\/4defa38da89de87e400861e73396baad\",\"name\":\"nike0good\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g\",\"caption\":\"nike0good\"},\"sameAs\":[\"https:\\\/\\\/nike0good.com\"],\"url\":\"https:\\\/\\\/nike0good.com\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09 - nike0good","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nike0good.com\/?p=275","og_locale":"zh_CN","og_type":"article","og_title":"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09 - nike0good","og_description":"E. XOR on Segment time limit per test 4 seconds memory [&hellip;]","og_url":"https:\/\/nike0good.com\/?p=275","og_site_name":"nike0good","article_published_time":"2012-11-20T00:43:00+00:00","author":"nike0good","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"nike0good","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nike0good.com\/?p=275#article","isPartOf":{"@id":"https:\/\/nike0good.com\/?p=275"},"author":{"name":"nike0good","@id":"https:\/\/nike0good.com\/#\/schema\/person\/4defa38da89de87e400861e73396baad"},"headline":"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09","datePublished":"2012-11-20T00:43:00+00:00","mainEntityOfPage":{"@id":"https:\/\/nike0good.com\/?p=275"},"wordCount":109,"commentCount":0,"keywords":["zkw\u7ebf\u6bb5\u6811","\u4f4d\u8fd0\u7b97"],"articleSection":["DefaultCategory"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nike0good.com\/?p=275#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nike0good.com\/?p=275","url":"https:\/\/nike0good.com\/?p=275","name":"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09 - nike0good","isPartOf":{"@id":"https:\/\/nike0good.com\/#website"},"datePublished":"2012-11-20T00:43:00+00:00","author":{"@id":"https:\/\/nike0good.com\/#\/schema\/person\/4defa38da89de87e400861e73396baad"},"breadcrumb":{"@id":"https:\/\/nike0good.com\/?p=275#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nike0good.com\/?p=275"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nike0good.com\/?p=275#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nike0good.com\/"},{"@type":"ListItem","position":2,"name":"CF 242E(zkw\u7ebf\u6bb5\u6811-\u62c6\u4f4d\uff09"}]},{"@type":"WebSite","@id":"https:\/\/nike0good.com\/#website","url":"https:\/\/nike0good.com\/","name":"nike0good","description":"\u6709\u6240\u4f5c\u4e3a\u662f\u4eba\u751f\u7684\u6700\u9ad8\u5883\u754c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nike0good.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/nike0good.com\/#\/schema\/person\/4defa38da89de87e400861e73396baad","name":"nike0good","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/secure.gravatar.com\/avatar\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8e5fa08d5c367a1a6fb5ff13bb10ed5a331f981513256951290ae42322da6854?s=96&d=identicon&r=g","caption":"nike0good"},"sameAs":["https:\/\/nike0good.com"],"url":"https:\/\/nike0good.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=275"}],"version-history":[{"count":0,"href":"https:\/\/nike0good.com\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions"}],"wp:attachment":[{"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nike0good.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}