QOJ.ac

QOJ

時間限制: 2.0 s 記憶體限制: 512 MB 總分: 100 可 Hack ✓

#14427. Kompresi Domain

统计

Gojo memiliki sebuah pohon dengan $n$ simpul. Ia mempelajari teknik kompresi domain (domain compression), yang bekerja sebagai berikut:

  • Pertama, ia memilih suatu simpul $v$ yang sebelumnya belum dihapus dari graf. Selanjutnya, untuk setiap pasangan simpul $u < w$ yang terhubung dengan $v$, ia menambahkan sebuah sisi tak berarah $(u, w)$ jika sisi tersebut sebelumnya belum ada di dalam graf. Setelah itu, ia menghapus $v$ dari graf beserta semua sisi yang bersisian dengannya.

Untuk setiap $k$ ($1 \le k \le n$), ia tertarik pada total banyaknya sisi pada graf yang tersisa untuk seluruh $\frac{n!}{(n-k)!}$ cara melakukan operasi tersebut. Karena jawabannya bisa sangat besar, keluarkan hasilnya modulo $998\,244\,353$.

Masukan

Baris pertama berisi sebuah bilangan bulat $n$ ($2 \le n \le 10^5$) — banyaknya simpul pada pohon.

Selanjutnya, $n - 1$ baris berisi pasangan bilangan bulat $u_i, v_i$ ($1 \le u_i, v_i \le n$) — deskripsi sisi-sisi pada pohon.

Keluaran

Keluarkan $n$ bilangan bulat — total banyaknya sisi untuk setiap $k$ modulo $998\,244\,353$.

Contoh

Masukan 1

5
1 2
2 3
3 5
3 4

Keluaran 1

16 44 60 0 0

Masukan 2

8
1 2
2 3
2 4
4 5
4 7
7 8
6 7

Keluaran 2

51 316 1596 6120 15720 20160 0 0

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#365EditorialOpen题解jianglyView

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.