经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

Brackets

📝 题解 🔵 仅限 C++
题目描述
<div class="Section0"> <p class="p0" style="text-indent:24.0000pt;"> <span style="line-height:1.5;">This&nbsp;year&nbsp;MK&nbsp;is&nbsp;</span><span style="line-height:1.5;">5&nbsp;years&nbsp;old.&nbsp;So&nbsp;he&nbsp;decides&nbsp;to&nbsp;learn&nbsp;some&nbsp;</span><a href="app:ds:arithmetic">arithmetic</a><span style="line-height:1.5;">.&nbsp;But&nbsp;he&nbsp;was&nbsp;confused&nbsp;by&nbsp;how&nbsp;to&nbsp;write&nbsp;the&nbsp;brackets.&nbsp;He&nbsp;has&nbsp;already&nbsp;known&nbsp;that&nbsp;the&nbsp;brackets&nbsp;should&nbsp;match&nbsp;when&nbsp;writing&nbsp;them&nbsp;correctly.&nbsp;Such&nbsp;as&nbsp;“()(())”&nbsp;is&nbsp;correct&nbsp;but&nbsp;“())(”&nbsp;is&nbsp;not.</span> </p> <p class="p0" style="text-indent:24.0000pt;"> The&nbsp;problem&nbsp;is&nbsp;that,&nbsp;if&nbsp;there&nbsp;are&nbsp;N&nbsp;pairs&nbsp;of&nbsp;brackets,&nbsp;how&nbsp;many&nbsp;ways&nbsp;that&nbsp;MK&nbsp;can&nbsp;write&nbsp;them&nbsp;correctly? &nbsp; </p> <p class="p0"> <br /> </p> </div>
输入格式
<span>&nbsp;There&nbsp;are&nbsp;several&nbsp;test&nbsp;cases.&nbsp;Each&nbsp;case&nbsp;contains&nbsp;a&nbsp;number&nbsp;N&nbsp;(1&nbsp;&lt;=&nbsp;N&nbsp;&lt;=&nbsp;1000)&nbsp;indicating&nbsp;the&nbsp;pairs&nbsp;of&nbsp;brackets.</span>
输出格式
<span>For&nbsp;each&nbsp;case,&nbsp;please&nbsp;output&nbsp;the&nbsp;answer&nbsp;mod&nbsp;1,000,000,007.</span>
样例
样例输入 1
5 7
样例输出 1
42 429
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用