Need help in problem Afghan Jerseys from ACM ICPC Amritapuri Onsite 2014

Revision en1, by kipawa, 2016-10-04 18:00:02

I am currently trying the following problem.
I have some thoughts for solution but I am unable to solve it completely.
My thoughts are as follows — If we have a pattern like a*b, then if the first occurrence of 'a' in string t is at index i and the last occurrence of 'b' in string t is at index j. Then our answer will be the number of distinct subsequences of the string t(i,j). Here t(i,j) means the substring of string t from index i to index j.

But the problem is that I am unable to think of a general solution. I am also not able to find any editorials. Please help me!

Tags help needed, dynamic programming, acm icpc, acm-icpc amritapuri

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English kipawa 2016-10-04 18:00:02 733 Initial revision (published)