Exotic_sum's blog

By Exotic_sum, history, 9 hours ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
8 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

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