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

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

Given three integers p, q, r. Then provide p strings, q strings, and r strings. Find the number of string pairs (AB) that satisfy:

A is a prefix of some string in the p strings;

B is a suffix of some string in the q strings;

The concatenated string AB of A and B is a substring of some string in the r strings. p, q, r are all less than or equal to 300,000, and the total length of the p strings is less than or equal to 300,000, the total length of the q strings is less than or equal to 300,000, and the total length of the r strings is less than or equal to 300,000. Please provide an implementation that runs within 3 seconds and uses no more than 1GB of memory to solve this problem.

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

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

Auto comment: topic has been updated by Exotic_sum (previous revision, new revision, compare).