{"id":58069,"date":"2025-08-16T01:30:16","date_gmt":"2025-08-15T17:30:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/58069.html"},"modified":"2025-08-16T01:30:16","modified_gmt":"2025-08-15T17:30:16","slug":"%e6%a0%91%e4%b8%8a%e5%90%af%e5%8f%91%e5%bc%8f%e5%90%88%e5%b9%b6-%e8%8e%ab%e9%98%9f-tree-and-queries","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/58069.html","title":{"rendered":"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries"},"content":{"rendered":"<p>\u9898\u76ee\u94fe\u63a5&#xff1a;Problem &#8211; D &#8211; Codeforces<\/p>\n<h3>\u9898\u76ee\u5927\u610f&#xff1a;<\/h3>\n<p>\u4e00\u68f5\u6811\u4e0a (n &lt;&#061; 1e5) \u6bcf\u4e2a\u70b9\u90fd\u6709\u4e00\u4e2a\u989c\u8272 (ci &lt;&#061; 1e5) &#xff0c;m (m &lt;&#061; 1e5) \u6b21\u8be2\u95ee&#xff0c;\u6bcf\u6b21\u8be2\u95ee\u5305\u542b\u4e00\u4e2a v \u548c\u4e00\u4e2a k &#xff0c;\u7edf\u8ba1 v \u7684\u5b50\u6811\u4e2d\u8fd9\u6837\u7684\u989c\u8272 x \u7684\u79cd\u7c7b\u6570&#xff1a;\u81f3\u5c11\u6709 k \u4e2a\u70b9\u7684\u989c\u8272\u4e3a x \u3002<\/p>\n<h3>Solution1:<\/h3>\n<p>\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76&#xff0c;\u8bb0\u5f55\u6bcf\u4e2a\u989c\u8272\u51fa\u73b0\u7684\u6b21\u6570 col[i]&#xff0c;\u4ee5\u53ca\u4e00\u4e2a\u6570\u7ec4<span style=\"color:#956fe7\"> num[i] \u8868\u793a\u51fa\u73b0\u6b21\u6570\u81f3\u5c11\u4e3a i \u7684\u989c\u8272\u6570<\/span>\u3002&#xff08;\u6ce8\u610f\u6211\u4eec\u53ef\u4ee5\u5728\u66f4\u65b0 col \u7684\u540c\u65f6 O(1) \u66f4\u65b0 num&#xff09;<\/p>\n<p>Code:<\/p>\n<p>#include&lt;cstdio&gt;<br \/>\n#include&lt;cstring&gt;<br \/>\n#include&lt;vector&gt;<br \/>\nusing namespace std;<\/p>\n<p>#define N 100005<\/p>\n<p>int n,m,cnt;<br \/>\nint c[N],st[N],siz[N],son[N],dfn[N],col[N],num[N],id[N],ans[N];<\/p>\n<p>vector&lt; pair&lt;int,int&gt; &gt; q[N];<\/p>\n<p>struct Edge<br \/>\n{<br \/>\n    int next,to;<br \/>\n}ed[N &lt;&lt; 1];<\/p>\n<p>void add(int u,int v)<br \/>\n{<br \/>\n    ed[&#043;&#043; cnt].next &#061; st[u];<br \/>\n    ed[cnt].to &#061; v;<br \/>\n    st[u] &#061; cnt;<br \/>\n    return;<br \/>\n}<\/p>\n<p>void pdfs(int x,int fa)<br \/>\n{<br \/>\n    siz[x] &#061; 1;<br \/>\n    dfn[x] &#061; &#043;&#043; cnt;<br \/>\n    id[cnt] &#061; x;<br \/>\n    for (int i &#061; st[x]; ~i ;i &#061; ed[i].next)<br \/>\n    {<br \/>\n        int rec &#061; ed[i].to;<br \/>\n        if(rec &#061;&#061; fa) continue;<br \/>\n        pdfs(rec,x);<br \/>\n        siz[x] &#043;&#061; siz[rec];<br \/>\n        if(!son[x] || siz[rec] &gt; siz[son[x]]) son[x] &#061; rec;<br \/>\n    }<br \/>\n    return;<br \/>\n}<\/p>\n<p>void calc(int x) { &#043;&#043; col[x] , &#043;&#043; num[col[x]] ; }<\/p>\n<p>void del(int x) { &#8212; num[col[x]] , &#8212; col[x] ; }<\/p>\n<p>void dfs(int x,int fa,int op)<br \/>\n{<br \/>\n    for (int i &#061; st[x]; ~i ;i &#061; ed[i].next)<br \/>\n    {<br \/>\n        int rec &#061; ed[i].to;<br \/>\n        if(rec &#061;&#061; fa || rec &#061;&#061; son[x]) continue;<br \/>\n        dfs(rec,x,0);<br \/>\n    }<br \/>\n    if(son[x]) dfs(son[x],x,1);<br \/>\n    calc(c[x]);<br \/>\n    for (int i &#061; st[x]; ~i ;i &#061; ed[i].next)<br \/>\n    {<br \/>\n        int rec &#061; ed[i].to;<br \/>\n        if(rec &#061;&#061; fa || rec &#061;&#061; son[x]) continue;<br \/>\n        for (int j &#061; dfn[rec];j &lt;&#061; dfn[rec] &#043; siz[rec] &#8211; 1;&#043;&#043; j)<br \/>\n            calc(c[id[j]]);<br \/>\n    }<br \/>\n    for (auto i : q[x]) ans[i.first] &#061; num[i.second];<br \/>\n    if(!op)<br \/>\n    {<br \/>\n        for (int i &#061; dfn[x];i &lt;&#061; dfn[x] &#043; siz[x] &#8211; 1;&#043;&#043; i)<br \/>\n            del(c[id[i]]);<br \/>\n    }<br \/>\n    return;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    memset(st,-1,sizeof st);<br \/>\n    scanf(&#034;%d%d&#034;,&amp;n,&amp;m),cnt &#061; 0;<br \/>\n    for (int i &#061; 1;i &lt;&#061; n;&#043;&#043; i) scanf(&#034;%d&#034;,&amp;c[i]);<br \/>\n    for (int i &#061; 1,u,v;i &lt; n;&#043;&#043; i)<br \/>\n        scanf(&#034;%d%d&#034;,&amp;u,&amp;v),add(u,v),add(v,u);<br \/>\n    for (int i &#061; 1,v,k;i &lt;&#061; m;&#043;&#043; i)<br \/>\n    {<br \/>\n        scanf(&#034;%d%d&#034;,&amp;v,&amp;k);<br \/>\n        q[v].push_back({i,k});<br \/>\n    }<br \/>\n    cnt &#061; 0;<br \/>\n    pdfs(1,0);<br \/>\n    dfs(1,0,1);<br \/>\n    for (int i &#061; 1;i &lt;&#061; m;&#043;&#043; i) printf(&#034;%d\\\\n&#034;,ans[i]);<br \/>\n    return 0;<br \/>\n} <\/p>\n<h3>Solution2:<\/h3>\n<p>\u5229\u7528 &#034;\u5b50\u6811\u5185\u8282\u70b9\u7684 dfn \u662f\u4e00\u6bb5\u8fde\u7eed\u533a\u95f4&#034; &#xff0c;\u53ef\u4ee5<span style=\"color:#956fe7\">\u5c06\u7edf\u8ba1\u5b50\u6811\u5185\u7684\u7b54\u6848\u8f6c\u5316\u6210\u7edf\u8ba1\u533a\u95f4\u5185\u7684\u7b54\u6848<\/span>&#xff0c;\u79bb\u7ebf\u83ab\u961f\u5904\u7406\u3002<\/p>\n<p>Code:<\/p>\n<p>#include&lt;cstdio&gt;<br \/>\n#include&lt;cstring&gt;<br \/>\n#include&lt;cmath&gt;<br \/>\n#include&lt;algorithm&gt;<br \/>\nusing namespace std;<\/p>\n<p>#define N 100005<\/p>\n<p>int n,m,cnt,B;<br \/>\nint c[N],st[N],dfn[N],siz[N],col[N],num[N],id[N],ans[N],bel[N];<\/p>\n<p>struct Query<br \/>\n{<br \/>\n    int l,r,bar,id;<br \/>\n}q[N];<\/p>\n<p>struct Edge<br \/>\n{<br \/>\n    int next,to;<br \/>\n}ed[N &lt;&lt; 1];<\/p>\n<p>int cmp(Query x,Query y)<br \/>\n{<br \/>\n    if(bel[x.l] &#061;&#061; bel[y.l]) return x.r &lt; y.r ;<br \/>\n    return bel[x.l] &lt; bel[y.l] ;<br \/>\n}<\/p>\n<p>void added(int u,int v)<br \/>\n{<br \/>\n    ed[&#043;&#043; cnt].next &#061; st[u];<br \/>\n    ed[cnt].to &#061; v;<br \/>\n    st[u] &#061; cnt;<br \/>\n    return;<br \/>\n}<\/p>\n<p>void dfs(int x,int fa)<br \/>\n{<br \/>\n    dfn[x] &#061; &#043;&#043; cnt;<br \/>\n    id[cnt] &#061; x;<br \/>\n    siz[x] &#061; 1;<br \/>\n    for (int i &#061; st[x]; ~i ;i &#061; ed[i].next)<br \/>\n    {<br \/>\n        int rec &#061; ed[i].to;<br \/>\n        if(rec &#061;&#061; fa) continue;<br \/>\n        dfs(rec,x);<br \/>\n        siz[x] &#043;&#061; siz[rec];<br \/>\n    }<br \/>\n    return;<br \/>\n}<\/p>\n<p>void add(int x) { &#043;&#043; col[c[id[x]]] , &#043;&#043; num[col[c[id[x]]]] ; }<\/p>\n<p>void sub(int x) { &#8212; num[col[c[id[x]]]] , &#8212; col[c[id[x]]] ; }<\/p>\n<p>int main()<br \/>\n{<br \/>\n    memset(st,-1,sizeof st);<br \/>\n    scanf(&#034;%d%d&#034;,&amp;n,&amp;m),cnt &#061; 0,B &#061; (int)sqrt(n);<br \/>\n    for (int i &#061; 1;i &lt;&#061; n;&#043;&#043; i) scanf(&#034;%d&#034;,&amp;c[i]),bel[i] &#061; (i &#8211; 1) \/ B &#043; 1;<br \/>\n    for (int i &#061; 1,u,v;i &lt; n;&#043;&#043; i)<br \/>\n        scanf(&#034;%d%d&#034;,&amp;u,&amp;v),added(u,v),added(v,u);<br \/>\n    cnt &#061; 0;<br \/>\n    dfs(1,0);<br \/>\n    for (int i &#061; 1,v,k;i &lt;&#061; m;&#043;&#043; i)<br \/>\n    {<br \/>\n        scanf(&#034;%d%d&#034;,&amp;v,&amp;k);<br \/>\n        q[i].l &#061; dfn[v];<br \/>\n        q[i].r &#061; dfn[v] &#043; siz[v] &#8211; 1;<br \/>\n        q[i].bar &#061; k;<br \/>\n        q[i].id &#061; i;<br \/>\n    }<br \/>\n    sort(q &#043; 1,q &#043; m &#043; 1,cmp);<br \/>\n    int l,r;<br \/>\n    l &#061; 1,r &#061; 0;<br \/>\n    for (int i &#061; 1;i &lt;&#061; m;&#043;&#043; i)<br \/>\n    {<br \/>\n        while (l &gt; q[i].l) add(&#8211; l);<br \/>\n        while (l &lt; q[i].l) sub(l &#043;&#043;);<br \/>\n        while (r &lt; q[i].r) add(&#043;&#043; r);<br \/>\n        while (r &gt; q[i].r) sub(r &#8211;);<br \/>\n        ans[q[i].id] &#061; num[q[i].bar];<br \/>\n    }<br \/>\n    for (int i &#061; 1;i &lt;&#061; m;&#043;&#043; i) printf(&#034;%d\\\\n&#034;,ans[i]);<br \/>\n    return 0;<br \/>\n} <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb81\u6b21\u3002\u4e00\u68f5\u6811\u4e0a (n &lt;= 1e5) \u6bcf\u4e2a\u70b9\u90fd\u6709\u4e00\u4e2a\u989c\u8272 (ci &lt;= 1e5) \uff0cm (m &lt;= 1e5) \u6b21\u8be2\u95ee\uff0c\u6bcf\u6b21\u8be2\u95ee\u5305\u542b\u4e00\u4e2a v \u548c\u4e00\u4e2a k \uff0c\u7edf\u8ba1\u3002\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\uff0c\u8bb0\u5f55\u6bcf\u4e2a\u989c\u8272\u51fa\u73b0\u7684\u6b21\u6570 col[i]\uff0c\u4ee5\u53ca\u4e00\u4e2a\u6570\u7ec4\u3002\uff08\u6ce8\u610f\u6211\u4eec\u53ef\u4ee5\u5728\u66f4\u65b0 col \u7684\u540c\u65f6 O(1) \u66f4\u65b0 num\uff09\u5229\u7528 &quot;\u5b50\u6811\u5185\u8282\u70b9\u7684 dfn \u662f\u4e00\u6bb5\u8fde\u7eed\u533a\u95f4&quot; \uff0c\u53ef\u4ee5\u3002\u5c06\u7edf\u8ba1\u5b50\u6811\u5185\u7684\u7b54\u6848\u8f6c\u5316\u6210\u7edf\u8ba1\u533a\u95f4\u5185\u7684\u7b54\u6848\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6104,427,6103],"topic":[],"class_list":["post-58069","post","type-post","status-publish","format-standard","hentry","category-server","tag-6104","tag-427","tag-6103"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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:\/\/www.wsisp.com\/helps\/58069.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb81\u6b21\u3002\u4e00\u68f5\u6811\u4e0a (n &lt;= 1e5) \u6bcf\u4e2a\u70b9\u90fd\u6709\u4e00\u4e2a\u989c\u8272 (ci &lt;= 1e5) \uff0cm (m &lt;= 1e5) \u6b21\u8be2\u95ee\uff0c\u6bcf\u6b21\u8be2\u95ee\u5305\u542b\u4e00\u4e2a v \u548c\u4e00\u4e2a k \uff0c\u7edf\u8ba1\u3002\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\uff0c\u8bb0\u5f55\u6bcf\u4e2a\u989c\u8272\u51fa\u73b0\u7684\u6b21\u6570 col[i]\uff0c\u4ee5\u53ca\u4e00\u4e2a\u6570\u7ec4\u3002\uff08\u6ce8\u610f\u6211\u4eec\u53ef\u4ee5\u5728\u66f4\u65b0 col \u7684\u540c\u65f6 O(1) \u66f4\u65b0 num\uff09\u5229\u7528 &quot;\u5b50\u6811\u5185\u8282\u70b9\u7684 dfn \u662f\u4e00\u6bb5\u8fde\u7eed\u533a\u95f4&quot; \uff0c\u53ef\u4ee5\u3002\u5c06\u7edf\u8ba1\u5b50\u6811\u5185\u7684\u7b54\u6848\u8f6c\u5316\u6210\u7edf\u8ba1\u533a\u95f4\u5185\u7684\u7b54\u6848\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/58069.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-15T17:30:16+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58069.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/58069.html\",\"name\":\"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-15T17:30:16+00:00\",\"dateModified\":\"2025-08-15T17:30:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/58069.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/58069.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58069.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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:\/\/www.wsisp.com\/helps\/58069.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb81\u6b21\u3002\u4e00\u68f5\u6811\u4e0a (n &lt;= 1e5) \u6bcf\u4e2a\u70b9\u90fd\u6709\u4e00\u4e2a\u989c\u8272 (ci &lt;= 1e5) \uff0cm (m &lt;= 1e5) \u6b21\u8be2\u95ee\uff0c\u6bcf\u6b21\u8be2\u95ee\u5305\u542b\u4e00\u4e2a v \u548c\u4e00\u4e2a k \uff0c\u7edf\u8ba1\u3002\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\uff0c\u8bb0\u5f55\u6bcf\u4e2a\u989c\u8272\u51fa\u73b0\u7684\u6b21\u6570 col[i]\uff0c\u4ee5\u53ca\u4e00\u4e2a\u6570\u7ec4\u3002\uff08\u6ce8\u610f\u6211\u4eec\u53ef\u4ee5\u5728\u66f4\u65b0 col \u7684\u540c\u65f6 O(1) \u66f4\u65b0 num\uff09\u5229\u7528 &quot;\u5b50\u6811\u5185\u8282\u70b9\u7684 dfn \u662f\u4e00\u6bb5\u8fde\u7eed\u533a\u95f4&quot; \uff0c\u53ef\u4ee5\u3002\u5c06\u7edf\u8ba1\u5b50\u6811\u5185\u7684\u7b54\u6848\u8f6c\u5316\u6210\u7edf\u8ba1\u533a\u95f4\u5185\u7684\u7b54\u6848\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/58069.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-15T17:30:16+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/58069.html","url":"https:\/\/www.wsisp.com\/helps\/58069.html","name":"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-15T17:30:16+00:00","dateModified":"2025-08-15T17:30:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/58069.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/58069.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/58069.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6811\u4e0a\u542f\u53d1\u5f0f\u5408\u5e76\/\u83ab\u961f Tree and Queries"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=58069"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58069\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=58069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=58069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=58069"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=58069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}