Codeforces Round #678 DIV2 D問題 (2000pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, X[2d5], Y[2d5]; ll A[2d5];
graph g;
ll sm[2d5]; int lf[2d5], sz[2d5];
{
ll res = 0;
rd(N,(X--)(N-1),A(N));
rep(i,N-1) Y[i] = i+1;
g.setDirectEdge(N,N-1,X,Y);
rep(i,N) if(g.es[i]==0) lf[i] = 1;
g.SubTreeWeight(0, lf, sz);
g.SubTreeWeight(0, A, sm);
rep(i,N) res >?= sm[i] /+ sz[i];
wt(res);
}
Current time: 2024年04月18日21時28分37秒
Last modified: 2020年11月16日23時27分50秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF678 CF_DIV2_D
トップページに戻る
Logged in as: unknown user (not login)