Codeforces Round #635 DIV1 A問題 (500pt)
Codeforces Round #635 DIV2 C問題 (1500pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, K, A[2d5], B[2d5];
graph g;
int dist[2d5], sz[2d5]; ll gain[2d5];
{
rd(N,K,(A--,B--)(N-1));
g.setEdge(N,N-1,A,B);
g.getDist(0, dist);
g.SubTreeSize(0, sz);
rep(i,N) gain[i] = dist[i] - sz[i] + 1;
rsortA(N, gain);
wt(sum(gain(K)));
}
Current time: 2024年04月26日21時11分11秒
Last modified: 2020年04月18日14時11分36秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF635 CF_Div1_A CF_Div2_C
トップページに戻る
Logged in as: unknown user (not login)