Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

Longest Regular Bracket Sequence

$
0
0

http://codeforces.com/problemset/problem/5/C

Didn't understood the meaning of:

"a bracket sequence is called regular, if by inserting «+» and «1» into it we can get a correct mathematical expression."

In the example, «(())()» is regular. Is the answer would be 6 1 ?

In the sample test «)((())))(()())» is 6 2. I understood why its 6 2

but if the input had been «)((()))(()())» i.e. removing the bold ')' in previous line, should the answer be 12 1 ?


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>