Help me Solve this problem

Правка en1, от Boring_Day, 2022-09-07 10:12:55

I was solving yesterday's c with a different approach. To solve it with my technique what i need to know is:

Let's say we have a string 's' of length 'n' with parenthesis ('(' or ')') and we have queries with 'L' and 'R' (1<=L<=R<=N).

we need to tell whether the substring from L to R is balanced or not.

Is there any way to solve the queries in constant time or lets say log(n) time?

Please Help.

Теги segment tree, dp, greedy, help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Boring_Day 2022-09-07 10:12:55 437 Initial revision (published)