相关链接
题目传送门:https://community.topcoder.com/stat?c=problem_statement&pm=14595&rd=16883
解题报告
不难发现,这就是统计括号匹配的方案数
不会的同学可以先去切BZOJ 3622
Code
#include<bits/stdc++.h> #define LL long long using namespace std; const int N = 3000; const int MOD = 1000000007; int n,ans; char s[N]; class ParenthesisRemoval { public: int countWays(string ss) { n = ss.size(); for (int i=0;i<ss.size();i++) { s[i] = ss[i]; } ans = 1; for (int i=0,pfx=0;i<n;i++) { if (s[i] == '(') { ++pfx; } else { ans = (LL)ans * (pfx--) % MOD; } } return ans; } private: };
WOW just what I was searching for. Came here by searching for quest bars cheap
I know this if off topic but I’m looking into starting my own blog and was
wondering what all is required to get set up? I’m assuming having a blog like yours would cost a pretty penny?
I’m not very web smart so I’m not 100% certain. Any tips or advice would be greatly appreciated.
Cheers
Howdy! This post could not be written any better! Reading through this post reminds
me of my previous room mate! He always kept chatting
about this. I will forward this page to him.
Fairly certain he will have a good read. Thanks for sharing!
Your style is very unique compared to other people I’ve read stuff
from. Thanks for posting when you have the opportunity, Guess
I will just bookmark this page.
What’s up to every , for the reason that I am really eager of reading this blog’s post to be updated daily.
It consists of nice information.
Hey! I know this is kinda off topic however , I’d figured I’d ask.
Would you be interested in exchanging links or maybe guest writing a blog post or vice-versa?
My blog goes over a lot of the same subjects as yours and I
think we could greatly benefit from each other. If you are interested feel free
to send me an e-mail. I look forward to hearing from you!
Great blog by the way!
Wow! This blog looks exactly like my old one! It’s on a totally
different topic but it has pretty much the same page
layout and design. Superb choice of colors!
Good day! This is kind of off topic but I need some advice from an established blog.
Is it very difficult to set up your own blog? I’m not very techincal but I
can figure things out pretty quick. I’m thinking about setting up my own but I’m not sure where to begin. Do you have any points or
suggestions? Appreciate it
I all the time used to read piece of writing in news
papers but now as I am a user of internet thus from now I am
using net for articles, thanks to web.
If you would like to increase your know-how just keep visiting this website and be updated
with the most up-to-date information posted here.
For most up-to-date news you have to pay a quick visit the
web and on world-wide-web I found this site as a best web site for hottest updates.
It’s truly very complicated in this full of activity life to listen news
on Television, therefore I simply use web for that purpose, and obtain the most
up-to-date news.
Excellent web site. A lot of useful info here. I’m sending it to some friends ans additionally sharing in delicious.
And naturally, thank you on your effort!
Thank you for sharing with us, I think this website genuinely stands out : D.
Hey there! I know this is kind of off-topic however I had to ask.
Does building a well-established blog such as yours take a large
amount of work? I’m completely new to writing a blog but I do write in my
journal everyday. I’d like to start a blog so I can share my experience and thoughts online.
Please let me know if you have any suggestions or tips
for new aspiring blog owners. Appreciate it!
Amazing! Its actually amazing piece of writing,
I have got much clear idea on the topic of from this article.
Every weekend i used to go to see this web site, for the reason that i wish for enjoyment, as this this
site conations truly fastidious funny stuff too.
Hi I am so grateful I found your web site, I really
found you by error, while I was searching on Google
for something else, Anyhow I am here now and would just like to say many thanks for
a fantastic post and a all round thrilling blog (I also love the theme/design), I don’t have
time to read it all at the moment but I have saved it and also added in your RSS feeds, so when I have time I will be back to read a great deal more,
Please do keep up the awesome job.
You should take part in a contest for one of the most useful
sites on the web. I’m going to recommend this site!
Thanks for sharing your thoughts about sling tv best
package 2020. Regards
Hello Dear, are you genuinely visiting this website on a regular basis, if so afterward you will without doubt obtain nice experience.
After examine just a few of the weblog posts in your website now, and I actually like your manner of blogging. I bookmarked it to my bookmark website record and shall be checking again soon. Pls take a look at my web site as nicely and let me know what you think.