Codeforces problem 5C — Longest Regular Bracket Sequence

Revision en1, by mir1198yusuf, 2020-05-05 04:52:15

For the below testcase, what should be the output :

(()())()(())()()())())()((()(()(())()()())((()(())()(()()()()))()(())()(((()())()(()((())()(())(()))

My answer is :

No of substring = 7 length of longest sequence = 18

Can anyone confirm because I feel codeforces test case is wrong here.?

My code : https://codeforces.com/contest/5/submission/79013600

Tags #codeforces, #bracket, #problem 5c, #stack

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English mir1198yusuf 2020-05-05 04:53:28 5 Tiny change: 'ring = 7\nlength o' -> 'ring = 7\n\nlength o'
en1 English mir1198yusuf 2020-05-05 04:52:15 429 Initial revision (published)