Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Блог пользователя kipawa

Автор kipawa, история, 8 лет назад, По-английски

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!

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится