Educational Codeforces Round 78 E問題 - Tests for problem D

Source

Educational Codeforces Round 78 E問題
Problem description

問題概要

省略

解法

省略

cLayversion 20191214-1)のコード

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

//no-unlocked
int N, A[5d5], B[5d5];
graph g;

int sz, arr[1d6];
int res[5d5][2];

void solve(int n){
  int i, j;
  rep(i,g.es[n]) arr[sz++] = g.edge[n][i];
  arr[sz++] = n;
  rrep(i,g.es[n]) solve(g.edge[n][i]);
}

{
  int i, j;

  rd(N,(A--,B--)(N-1));
  g.setEdgeRootedTree(N,N-1,A,B);

  arr[sz++] = 0;
  solve(0);

  rep(i,sz){
    j = arr[i];
    if(res[j][0]==0) res[j][0] = i+1, continue;
    res[j][1] = i+1;
  }
  rep(i,N) wt(res[i][0], res[i][1]);
}

Current time: 2024年04月18日21時44分30秒
Last modified: 2019年12月22日19時51分39秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: