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

33377번 - Hierarchies of Judges 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 2048 MB0000.000%

문제

In Treeland, a judicial reform is being carried out: the government needs to choose a new judicial hierarchy. The hierarchy will consist of $n$ judges conveniently labeled by integers from 1ドル$ to $n$.

The judicial hierarchy is a rooted labeled tree, and its vertices are the judges. Each judge has an ordered list of direct subordinates: child nodes in the rooted tree. Additionally, each judge in the judicial hierarchy is either reliable or unreliable.

The judicial hierarchy is called fair if the following is true for each judge: among him and all of his direct subordinates, at least half are reliable.

Two judicial hierarchies are considered different if at least one of three conditions holds true:

  • some judge is reliable in one hierarchy, and unreliable in the other;
  • for some judge, the set of his direct subordinates in one hierarchy differs from the set of his direct subordinates in the other;
  • for some judge, the relative order of his unreliable subordinates in one hierarchy is different from the relative order of his unreliable subordinates in another hierarchy.

You can check the notes section to better understand these conditions.

Government wants to choose a fair judicial hierarchy by going through all the possible options. In order to assess the scale of the work, they need to know how many different fair judicial hierarchies exist. Calculate this number modulo 998ドル,244円,353円$.

입력

The first line contains a single integer $n$ (1ドル \le n \le 2 \cdot 10^5$): the number of judges in the hierarchy.

출력

Print a single integer: the number of different fair judicial hierarchies with $n$ judges modulo 998ドル,244円,353円$.

제한

예제 입력 1

1

예제 출력 1

1

예제 입력 2

3

예제 출력 2

24

예제 입력 3

5

예제 출력 3

3190

예제 입력 4

100

예제 출력 4

413875584

노트

Below are some examples of judicial hierarchies to clarify the conditions.

The direct subordinates of each judge are placed below the judge, from left to right.

Reliable judges are gray, and unreliable judges are white.

These two fair hierarchies are considered the same:

These four are all different:

출처

Camp > Petrozavodsk Programming Camp > Summer 2023 > Day 5: Moscow IPT Yolki-Palki Contest 1 H번

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

출처

대학교 대회

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

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