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

31357번 - Dispersed parentheses 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB127758.333%

문제

The sequence of calculations in arithmetic expressions is usually set by a certain arrangement of parentheses. For example, $(3 \cdot (2+1)) \cdot (4-5)$. After deleting all the elements from the expression except parentheses remaining symbols form a parentheses sequence $(())()$. Let’s assume that adding character <<0ドル$>> does not corrupt the sequence. Let’s call such sequence a disperse parentheses sequence. Also this can be defined as follows:

  • An empty line is a disperse parentheses sequence.
  • If $S$ and $T$ --- disperse parentheses sequences, then lines 0ドルS, S0, (S)$ and $ST$ are also disperse parentheses sequences.

The depth of disperse parentheses sequence is the maximum difference between the number of opening and closing parentheses in the sequence prefix. (The prefix of line $S$ is the line, which can be obtained from $S$ by deleting symbols from the tail of the line. For example, the prefixes of line «$ABCAB$» are lines <<>>, <<$A$>>, <<$AB$>>, <<$ABC$>>, <<$ABCA$>> and <<$ABCAB$>>). Thus, the depth of the sequence «$(0)(0())0$» equals two (prefix «$(0)(0($» contains three openinig and one closing parentheses).

Calculate the number of possible disperse parentheses sequences $n$ symbols long, that have a depth $k$.

입력

Single line contains space-separated integers $n$ and $k$ (1ドル \le n \le 300,ドル 0ドル \le k \le n$).

출력

Output the number of possible disperse parentheses sequences $n$ symbols long, that have a depth $k$ modulo (10ドル^9+9$).

제한

예제 입력 1

3 0

예제 출력 1

1

예제 입력 2

3 1

예제 출력 2

3

예제 입력 3

3 2

예제 출력 3

0

힌트

출처

Contest > Open Cup > 2014/2015 Season > Stage 11: Grand Prix of Tatarstan > Division 1 B번

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

출처

대학교 대회

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

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