Logo
(追記) (追記ここまで)

19474번 - Values on a Tree 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB4715731.818%

문제

You are given a tree with $n$ vertices. The length of each edge is exactly 1. For any non-empty subset $S$ of the vertices, $\mathit{value} (S)$ is equal to the maximum of $\mathit{dis} (u, v)$ over all pairs $(u, v) \in S,ドル where $\mathit{dis} (u, v)$ is equal to the distance between $u$ and $v$ in the tree.

It is easy to find that $\mathit{value} (S)$ satisfies 0ドル \le \mathit{value} (S) < n$. For each 0ドル \le K \le n - 1,ドル print the number of the subsets $S$ such that $\mathit{value} (S) = K$.

입력

The first line of input contains an integer $n$ (1ドル \le n \le 3000$), the number of vertices in the graph. Then $n - 1$ lines follow. Each of them contains two integers $u$ and $v$ which mean that there is an edge between $u$ and $v$ (1ドル \le u, v \le n$). It is guaranteed that the given graph is a tree.

출력

Print a line containing exactly $n$ integers. The $i$-th integer must be the number of non-empty subsets $S$ which satisfy $\mathit{value} (S) = i - 1$. The answers may be very large, so print each answer modulo 998ドル,244円,353円$.

제한

예제 입력 1

2
1 2

예제 출력 1

2 1

예제 입력 2

4
1 3
2 4
4 1

예제 출력 2

4 3 4 4

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2016 > Day 4: Ce Bin and Ryyi Ji Contest 1 J번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /