Codeforces Round #766 DIV2 C問題 - Not Assigning

Source

Codeforces Round #766 DIV2 C問題 (1250pt)
Problem description

問題概要

省略

解法

省略

cLay(version 20211231-1)のコード

C++に変換後のコードはこちら

//no-unlocked
graph g;
REP(rd_int()){
  int @N, A[N-1], B[N-1], a, b, d, dist[N], res[N-1];
  rd((A--,B--)(N-1));
  g.setEdge(N,N-1,A,B);
  d = g.TreeDiameter(a,b);
  if(d != N-1) wt(-1), continue;
  g.getDist(a,dist);
  rep(i,N-1) res[i] = if[min(dist[A[i]], dist[B[i]]) % 2, 2, 3];
  wt(res(N-1));
}

Current time: 2024年05月19日01時40分39秒
Last modified: 2022年01月16日03時42分56秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF766 CF_DIV2_C
トップページに戻る

Logged in as: unknown user (not login)

ログイン: