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

8369번 - Enumeration of Road Network Plans 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB134430.769%

문제

Byteman is going for a car trip around Byteland, but he is unfortunately unable to buy a map of the country. His friends told him about some properties of the bytean road network:

  • There are n cities in Byteland, numbered from 1 to n.
  • Each road is bidirectional and connects two different cities.
  • Each pair of different cities is connected by exactly one path, consisting of one or more roads, on which no city appears more than once.
  • The longest path, on which no city appears more than once, consists of d roads.

Using information that he managed to collect, Byteman is going to try to reconstruct the road map of Byteland. Byteman would not like to work on it too much, so he would like to know the number of different road network plans satisfying the given conditions. During comparison of plans Byteman does not take exact locations of cities into consideration, but only the plan of connections; moreover, he is not interested in particular city numbers. In other words, Byteman considers two plans the same if and only if there exists a one-to-one mapping from cities of one plan to the cities of the other one, such that if cities u and v are connected by a road on the first plan then their equivalents u' and v' are also connected by a road on the second plan.

Write a program that:

  • reads numbers n, d and p from the standard input,
  • computes the number of different road network plans, that are consistent with information that Byteman managed to collect, modulo p,
  • writes the result to the standard output.

입력

The first and only line of the input contains three integers n, d and p (1 ≤ n ≤ 200, 0 ≤ d < n, n < p ≤ 109, p is a prime number), separated with single spaces.

출력

The first and only line of output should contain a single integer - the remainder of the division by p of the number of different plans that are consistent with conditions known to Byteman.

제한

예제 입력 1

6 3 13

예제 출력 1

2

힌트

출처

Contest > Algorithmic Engagements > PA 2008 7-7번

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

출처

대학교 대회

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

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