#P8798. [蓝桥杯 2022 国 A] 括号序列树
[蓝桥杯 2022 国 A] 括号序列树
Problem Description
There is a binary tree. The root node contains an empty string. For each node, the string on its left child is the string of its parent with one left parenthesis appended at the end, and the string on its right child is the string of its parent with one right parenthesis appended at the end. Each leaf node in the tree corresponds one-to-one to a valid bracket sequence consisting of pairs of parentheses.
Given , find the number of edges in a maximum matching of this tree.
Input Format
The input consists of one line containing an integer .
Output Format
Output one line containing an integer, representing the number of sequences that satisfy the condition. The answer may be very large, so output the remainder when divided by .
9
10350
Hint
[Test Case Scale and Assumptions]
- For of the test cases, .
- For of the test cases, .
- For of the test cases, .
- For of the test cases, .
- For all test cases, .
Lanqiao Cup 2022 National Contest Group A, Problem J.
Translated by ChatGPT 5