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

8357번 - Cliquers Strike Back 다국어

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

문제

An undirected graph is called a labeled cliquer if each connected component of the graph is a clique and the vertices of the graph are numbered with numbers from the set {1, ..., n}. Maurycy has drawn all labeled cliquers with n vertices on a piece of paper and is going to assess beauty of each of them with a number from the set {1, ..., m} (in particular, different cliquers may be assigned equal grades). In how many ways can he do this? The result should be computed modulo 109 - 401. The figure below depicts all labeled cliquers for n = 3.

입력

The only line of the standard input contains two integers n and m (1 ≤ n, m ≤ 1018), separated by a single space and denoting the number of vertices of each labeled cliquer and the number of grades respectively.

출력

The only line of the standard output should contain the number of possible sets of grades modulo 109 - 401.

제한

예제 입력 1

3 2

예제 출력 1

32

힌트

출처

Contest > Algorithmic Engagements > PA 2008 6-1번

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

출처

대학교 대회

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

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