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

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

Hi everyone!

I'm looking for classic problem: Given a string A and Q strings B_1, B_2, .., B_Q. For each i count the number of occurrence of the string B_i in string A.

Can you give me the link to the above problem in some online judge sites. Thanks

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

»
9 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Take a look at this page: http://www.ahmed-aly.com/Category.jsp?ID=35. The first and fourth problems are a bit simpler than what you described (you just have to answer whether Bi appears in A). The second is similar to them but takes place in a grid. The third is also slightly easier than what you described. I guess you're probably interested in them, though, because the idea is the same — just a small modification.

Anyway, Frequency Count is pretty much equivalent to what you're asking. Finally, I'd like to recommend USACO — Censoring (Gold Division), which is about the same difficulty. It's nice because it forces you to notice something important to avoid receiving TLE in a given testcase.