Bracket sequences

Правка en1, от ABalobanov, 2016-02-04 12:05:02

How to count number of bracket sequences with n opening brackets and m closing brackets so that the balance never gets negative? I came to this problem thinking about other one(D from previous Open Cup), and I can't solve it in sufficient complexity. Is there a way to do it with n <= 2000, m <= 2000, answering one query in O(1) time or somehow precomputing these values for all i, j <= 2000?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ABalobanov 2016-02-04 12:05:02 410 Initial revision (published)