Editorial for Số dãy ngoặc hợp lệ


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: old_creator

Đây là bài toán tổ hợp cơ bản: Với mỗi số tự nhiên \(n\), số dãy ngoặc hợp lệ độ dài \(n\) là số Catalan thứ \(n/2\) nếu \(n\) chẵn và là \(0\) trong trường hợp còn lại.

Để tính số Catalan, phép chia được thay bằng phép nhân nghịch đảo modulo \(10^9 + 7\).


Comments

There are no comments at the moment.