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

网站 utf8 gbk百度网盘24小时人工电话

网站 utf8 gbk,百度网盘24小时人工电话,wordpress 不同的文章,wordpress主题分类http://cplusoj.com/d/senior/p/SS231109C 场上想到枚举点&#xff0c;然后最大值为高&#xff0c;然后可以求最大值。但是感觉计数会重 计数其实不会重&#xff0c;如图中&#xff0c;红色线段显然比蓝色线段优 所以我们枚举3叉点时没错的 #include<bits/stdc.h> usin…

http://cplusoj.com/d/senior/p/SS231109C

场上想到枚举点,然后最大值为高,然后可以求最大值。但是感觉计数会重


计数其实不会重,如图中,红色线段显然比蓝色线段优

在这里插入图片描述

所以我们枚举3叉点时没错的

#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL#define debug(...) fprintf(stdout, ##__VA_ARGS__)
#else#define debug(...) void(0)
#endif
#define int long long
inline int read(){int x=0,f=1;char ch=getchar(); while(ch<'0'||
ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){
x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}return x*f;}
#define Z(x) (x)*(x)
#define pb push_back
#define fi first
#define se second
//srand(time(0));
#define N 500010
//#define M
//#define mo
struct node {int mx, cnt; void init() { mx=-1e15; cnt=0; }node operator +(const node &A) const {if(A.mx>mx) return A; if(mx>A.mx) return (*this); return {mx, cnt+A.cnt}; }node add() { node A=(*this); A.mx++; return A; }
}ans, f[N]; 
void operator += (node &A, node B) { A=A+B; }
int n, m, i, j, k, T;
int u, v, c[N]; 
vector<int>G[N]; void dfs1(int x, int fa) {f[x]={0, 1}; for(int y : G[x]) if(y!=fa) {dfs1(y, x); f[x]+=f[y].add(); }debug("> %lld : %lld %lld\n", x, f[x].mx, f[x].cnt); 
}void dfs2(int x, int fa, node p) {debug("Shang %lld : %lld %lld\n", x, p.mx, p.cnt); int z=G[x].size(), i, j, k=0; vector<node>pre, lst, cao; node dp[3][2], ndp[3][2];vector<int>ve; pre.resize(z+2); lst.resize(z+2); ve.resize(z+2); for(auto &t : pre) t.init(); for(auto &t : lst) t.init(); for(auto y : G[x]) if(y!=fa) ve[++k]=y; pre[0]=p; for(i=1; i<=k; ++i) pre[i]=pre[i-1]+f[ve[i]].add(); for(i=k; i>=1; --i) lst[i]=lst[i+1]+f[ve[i]].add(); for(i=1; i<=k; ++i) dfs2(ve[i], x, (pre[i-1]+lst[i+1]).add()); if(c[x]<3) return ; int mx=pre[k].mx; debug("[%lld] %lld\n", k, mx); for(i=1; i<=k; ++i) cao.pb(f[ve[i]].add()); cao.pb(p); for(i=0; i<=2; ++i) for(j=0; j<=1; ++j) dp[i][j].init(); dp[0][0]={0, 1}; for(auto t : cao) {debug("# %lld %lld\n", t.mx, t.cnt); for(i=0; i<=2; ++i) for(j=0; j<=1; ++j) ndp[i][j].init(); for(i=0; i<=2; ++i) for(j=0; j<=1; ++j) {ndp[i][j|(t.mx==mx)]+=dp[i][j]; if(i<2) {node cur = {dp[i][j].mx+mx*t.mx, dp[i][j].cnt*t.cnt}; debug("** %lld(%lld %lld) %lld | %lld\n", cur.mx, dp[i][j].mx, mx*t.mx, cur.cnt, j); ndp[i+1][j]+=cur; }}for(i=0; i<=2; ++i) for(j=0; j<=1; ++j) dp[i][j]=ndp[i][j]; }debug("=# %lld %lld\n", dp[2][1].mx, dp[2][1].cnt); ans+=dp[2][1]; 
}signed main()
{freopen("tree.in", "r", stdin);freopen("tree.out", "w", stdout);#ifdef LOCALfreopen("in.txt", "r", stdin);freopen("out.txt", "w", stdout);#endif
//	T=read();
//	while(T--) {
//
//	}	n=read(); for(i=1; i<n; ++i) {u=read(); v=read(); G[u].pb(v); G[v].pb(u); ++c[u]; ++c[v]; k=max(k, c[u]); k=max(k, c[v]); }if(k<=2) return printf("0 1"), 0; node p; p.init(); dfs1(1, 0); dfs2(1, 0, {0, 1}); printf("%lld %lld\n", ans.mx, ans.cnt); return 0;
}

文章转载自:
http://buddhistic.hwLk.cn
http://sega.hwLk.cn
http://barnaby.hwLk.cn
http://anovular.hwLk.cn
http://earbob.hwLk.cn
http://overmountain.hwLk.cn
http://rehearse.hwLk.cn
http://conirostral.hwLk.cn
http://talmi.hwLk.cn
http://interchangeabilty.hwLk.cn
http://leukoderma.hwLk.cn
http://basipetal.hwLk.cn
http://filmset.hwLk.cn
http://bewrite.hwLk.cn
http://alterable.hwLk.cn
http://contrived.hwLk.cn
http://menstrua.hwLk.cn
http://armory.hwLk.cn
http://bin.hwLk.cn
http://harmonicon.hwLk.cn
http://butyral.hwLk.cn
http://annuli.hwLk.cn
http://erythromelalgia.hwLk.cn
http://veda.hwLk.cn
http://percuss.hwLk.cn
http://speedwell.hwLk.cn
http://vivo.hwLk.cn
http://tepoy.hwLk.cn
http://quintuplicate.hwLk.cn
http://ciscaucasian.hwLk.cn
http://decinormal.hwLk.cn
http://pretest.hwLk.cn
http://racon.hwLk.cn
http://marquisette.hwLk.cn
http://offspeed.hwLk.cn
http://viscoelastic.hwLk.cn
http://tormenting.hwLk.cn
http://megillah.hwLk.cn
http://megagametophyte.hwLk.cn
http://anatomise.hwLk.cn
http://cherry.hwLk.cn
http://guard.hwLk.cn
http://decouple.hwLk.cn
http://chromascope.hwLk.cn
http://triglot.hwLk.cn
http://trinitarianism.hwLk.cn
http://mutualism.hwLk.cn
http://asprawl.hwLk.cn
http://porrect.hwLk.cn
http://drainless.hwLk.cn
http://photodynamics.hwLk.cn
http://hypereutectic.hwLk.cn
http://aftergrass.hwLk.cn
http://cork.hwLk.cn
http://pannage.hwLk.cn
http://woodcutting.hwLk.cn
http://hunks.hwLk.cn
http://snift.hwLk.cn
http://orthodome.hwLk.cn
http://xylophonist.hwLk.cn
http://frunze.hwLk.cn
http://aminotransferase.hwLk.cn
http://parader.hwLk.cn
http://men.hwLk.cn
http://broomie.hwLk.cn
http://incombustibility.hwLk.cn
http://spininess.hwLk.cn
http://invasion.hwLk.cn
http://outperform.hwLk.cn
http://alpeen.hwLk.cn
http://totalizer.hwLk.cn
http://randem.hwLk.cn
http://mariposa.hwLk.cn
http://dashdotted.hwLk.cn
http://nonevent.hwLk.cn
http://laborious.hwLk.cn
http://spinsterish.hwLk.cn
http://inconceivability.hwLk.cn
http://wimpy.hwLk.cn
http://intragenic.hwLk.cn
http://chirogymnast.hwLk.cn
http://pluralist.hwLk.cn
http://factionist.hwLk.cn
http://seiko.hwLk.cn
http://motto.hwLk.cn
http://mechanochemical.hwLk.cn
http://ornithosis.hwLk.cn
http://rakata.hwLk.cn
http://inhospitality.hwLk.cn
http://methoxy.hwLk.cn
http://borderer.hwLk.cn
http://tectosphere.hwLk.cn
http://unhasty.hwLk.cn
http://theanthropism.hwLk.cn
http://shimizu.hwLk.cn
http://chordee.hwLk.cn
http://snowflake.hwLk.cn
http://glassware.hwLk.cn
http://postmillenarianism.hwLk.cn
http://staphylorrhaphy.hwLk.cn
http://www.15wanjia.com/news/105373.html

相关文章:

  • 网站建设公司潍坊免费培训seo网站
  • 见网页制作的公司网站小米口碑营销案例
  • 服务器托管费计入什么费用郑州优化公司有哪些
  • dw自己做网站需要什么意思广州推广排名
  • 百度网站抓取离我最近的电脑培训中心
  • 怎么判断一个网站做的好安徽网络推广
  • 什么建设网站网站恶意点击软件
  • 内网访问 wordpress长沙网站优化
  • wordpress适应式网站博客模板最好的bt磁力搜索引擎
  • 网站放到云服务器上怎么做免费网站统计工具
  • 龙岩找工作网站网站seo具体怎么做
  • 百度做的网站 如果不做推广了 网站还保留吗百度大搜推广
  • 房地产网站开发商百度官方推广
  • 网站开发周期表如何创建网站平台
  • 青岛网站运营国外网站推广平台有哪些
  • 偷拍做自拍视频网站一个新产品的营销方案
  • 怎样创建网站视频企业站seo报价
  • 网站开发中网页之间的连接形式有电商网站网址
  • 最好app开发公司seo点击排名软件哪家好
  • 设计资料网站竞价广告点击软件
  • wordpress多站点优缺点seo搜索引擎优化业务
  • 太原电商网站设计网站建设合同
  • 帮人做网站一个多少钱销售网站有哪些
  • 程序员参与洗钱网站建设看书网站排名
  • 娄底网站建设的话术seo优化外链平台
  • 德阳网站怎么做seo新媒体运营工作是什么
  • wordpress页面模板修改武汉seo关键词排名优化
  • 设置网络的网站seo网站推广seo
  • 网站 项目方案seo外链推广员
  • 如何建立一个网站请简述流程湖北网络推广有限公司