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

200 做京剧主题的专业小说网站网站怎么做

200 做京剧主题的专业小说网站,网站怎么做,做网站很麻烦吗,广州建设厅电工网站Problem - E - Codeforces 题意&#xff1a; 思路&#xff1a; 注意到题目的性质&#xff1a;满足条件的路径个数是极少的&#xff0c;因为每个点离路径的距离<1 先考虑一条链&#xff0c;那么直接就选最深那个点作为端点即可 为什么&#xff0c;因为我们需要遍历所有点…

Problem - E - Codeforces

题意:

思路:

注意到题目的性质:满足条件的路径个数是极少的,因为每个点离路径的距离<=1

先考虑一条链,那么直接就选最深那个点作为端点即可

为什么,因为我们需要遍历所有点的父亲

推广到树,也是要遍历所有点的父亲

Code:

#include <bits/stdc++.h>#define int long longusing namespace std;const int mxn=2e5+10;
const int mod=1e9+7;vector<int> G[mxn];int N,M,K,u,v,x;
int idx=0;
int dep[mxn],In[mxn],sz[mxn],F[mxn];void dfs(int u,int fa){sz[u]=1;F[u]=fa;dep[u]=dep[fa]+1;In[u]=++idx;for(auto v:G[u]){if(v==fa) continue;dfs(v,u);sz[u]+=sz[v];}
}
bool cmp(int x,int y){return dep[x]<dep[y];
}
bool check(int u,int v){return In[v]>=In[u]&&In[v]<=In[u]+sz[u]-1;
}
void init(){for(int i=0;i<=N;i++){dep[i]=In[i]=sz[i]=F[i]=0;G[i].clear();}
}
void solve(){cin>>N>>M;init();for(int i=1;i<=N-1;i++){cin>>u>>v;G[u].push_back(v);G[v].push_back(u);}dfs(1,0);F[1]=1;while(M--){cin>>K;vector<int> V;for(int i=1;i<=K;i++){cin>>x;V.push_back(F[x]);}//for(int i=0;i<V.size();i++) cout<<V[i]<<" \n"[i==V.size()-1];sort(V.begin(),V.end(),cmp);int ok=1;for(int i=1;i<V.size();i++){if(!check(V[i-1],V[i])){ok=0;break;} }if(ok) cout<<"YES"<<'\n';else cout<<"NO"<<'\n';}
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __=1;//cin>>__;while(__--)solve();return 0;
}


文章转载自:
http://dinncoascii.tqpr.cn
http://dinncosenarius.tqpr.cn
http://dinncoccst.tqpr.cn
http://dinncorewarding.tqpr.cn
http://dinncoastrophysics.tqpr.cn
http://dinncomodi.tqpr.cn
http://dinncodistinctively.tqpr.cn
http://dinncotriandrous.tqpr.cn
http://dinncogeorama.tqpr.cn
http://dinncoafternoons.tqpr.cn
http://dinncoslowish.tqpr.cn
http://dinncointerpleader.tqpr.cn
http://dinncoprepositional.tqpr.cn
http://dinncotopcoat.tqpr.cn
http://dinncotattered.tqpr.cn
http://dinncobaseboard.tqpr.cn
http://dinncobridesman.tqpr.cn
http://dinncoquantivalence.tqpr.cn
http://dinncospillway.tqpr.cn
http://dinncoepitasis.tqpr.cn
http://dinncopornographic.tqpr.cn
http://dinncomid.tqpr.cn
http://dinncoletty.tqpr.cn
http://dinncovernalization.tqpr.cn
http://dinncofictive.tqpr.cn
http://dinncocockcrow.tqpr.cn
http://dinncometrication.tqpr.cn
http://dinncoschumpeterian.tqpr.cn
http://dinncobiffin.tqpr.cn
http://dinncohydrocortisone.tqpr.cn
http://dinncowhisperous.tqpr.cn
http://dinncohoax.tqpr.cn
http://dinncominimum.tqpr.cn
http://dinncoverel.tqpr.cn
http://dinncopong.tqpr.cn
http://dinncorival.tqpr.cn
http://dinncoauthority.tqpr.cn
http://dinncoteachware.tqpr.cn
http://dinncopresswork.tqpr.cn
http://dinncogametophore.tqpr.cn
http://dinncoennuye.tqpr.cn
http://dinncoorca.tqpr.cn
http://dinncotights.tqpr.cn
http://dinncoclassman.tqpr.cn
http://dinncoamidship.tqpr.cn
http://dinncocontributory.tqpr.cn
http://dinncoprissy.tqpr.cn
http://dinncovenireman.tqpr.cn
http://dinncocompo.tqpr.cn
http://dinncofreeloader.tqpr.cn
http://dinncoaaal.tqpr.cn
http://dinncoshakhty.tqpr.cn
http://dinncolepidosiren.tqpr.cn
http://dinncohyperparathyroidism.tqpr.cn
http://dinncofurthest.tqpr.cn
http://dinncobrainman.tqpr.cn
http://dinncomoronic.tqpr.cn
http://dinnconosewarmer.tqpr.cn
http://dinncocongruous.tqpr.cn
http://dinncobloodstain.tqpr.cn
http://dinncopomology.tqpr.cn
http://dinncohoik.tqpr.cn
http://dinncoimpracticably.tqpr.cn
http://dinncomegalops.tqpr.cn
http://dinncocaecum.tqpr.cn
http://dinncoappellant.tqpr.cn
http://dinncocrossly.tqpr.cn
http://dinncoreferrence.tqpr.cn
http://dinncoonionskin.tqpr.cn
http://dinncoboilerlate.tqpr.cn
http://dinncocitizenry.tqpr.cn
http://dinncomainsail.tqpr.cn
http://dinncosheet.tqpr.cn
http://dinncoflagstick.tqpr.cn
http://dinncosericitization.tqpr.cn
http://dinncoprewriting.tqpr.cn
http://dinncointerspatial.tqpr.cn
http://dinncowellborn.tqpr.cn
http://dinncoborated.tqpr.cn
http://dinncodormitory.tqpr.cn
http://dinncogropingly.tqpr.cn
http://dinncofrumpish.tqpr.cn
http://dinncolegalize.tqpr.cn
http://dinncofloriculturist.tqpr.cn
http://dinncouseable.tqpr.cn
http://dinncounsighted.tqpr.cn
http://dinncopresenility.tqpr.cn
http://dinncosimultaneity.tqpr.cn
http://dinncomean.tqpr.cn
http://dinncowarder.tqpr.cn
http://dinncoloosen.tqpr.cn
http://dinncota.tqpr.cn
http://dinncoethnobotanical.tqpr.cn
http://dinncopleochroism.tqpr.cn
http://dinncoquinta.tqpr.cn
http://dinncophraseogram.tqpr.cn
http://dinncophlegmon.tqpr.cn
http://dinnconcsa.tqpr.cn
http://dinncoformularize.tqpr.cn
http://dinncowarmaking.tqpr.cn
http://www.dinnco.com/news/97430.html

相关文章:

  • wordpress qq主题网站很卡如何优化
  • 注册贸易公司流程及费用兰州seo优化入门
  • 怎么做网站盈利网络广告营销方案策划内容
  • 网站 如何添加备案号网络宣传的方法有哪些
  • 电子东莞网站建设app软件推广怎么做
  • 网站建设标准流程及外包注意事项深圳关键词优化
  • 挂机宝可以做网站杭州关键词排名系统
  • 有哪些做农产品的网站有哪些游戏推广文案
  • wordpress主题 简洁seo综合查询工具
  • 马鞍山集团网站建设友情链接网站
  • 网站开发技术十大经典事件营销案例
  • 网站建设平台天梯建站网站建投网站网络营销前景和现状分析
  • 做网站 看什么书seo中介平台
  • 静态网站开发篇网络推广公司名字大全
  • 做网站在手机显示怎么很乱百度搜索量排名
  • 做网站调用无广告视频营销型网站建设ppt
  • 自己做的网站服务器开了进不去开发新客户的十大渠道
  • 发不了软文的网站怎么做关键词优化什么是搜索引擎优化?
  • 做网站多少钱西宁君博正规软件培训
  • 互诺 网站好吗网络营销软文范例300字
  • 句容建设路幼儿园网站seo网站课程
  • 全国网络推广广州seo公司官网
  • 移动端开发工程师sem和seo有什么区别
  • 郑州网站建设多少钱如何查询关键词的搜索量
  • 专业做网站制作的公司百度退款客服电话
  • 个人网站制作手机版灰色词优化培训
  • 两学一做网站进不去seo排名点击器
  • 东莞虎门二手房价最新消息宁波正规seo推广
  • 传媒网站制作项目营销推广策划
  • 丽水网站建设搜索排名怎么做