
Time Limit:10000ms
Case Time Limit:3000ms
Memory Limit:256MB
Description
In a running system, there are many logs produced within a short period of time, we’d like to know the count of the most frequent logs.
Logs are produced by a few non-empty format strings, the number of logs is N(1<=N<=20000), the maximum length of each log is 256.
Here we consider a log same with another when their edit distance (see note) is <= 5.
Also we have a) logs are all the same with each other produced by a certain format string b) format strings have edit distance 5 of each other.
Your program will be dealing with lots of logs, so please try to keep the time cost close to O(nl), where n is the number of logs, and l is the average log length.
Note edit distance is the minimum number of operations (insertdeletereplace a character) required to transform one string into the other, please refer to
http://en.wikipedia.orgwikiEdit_distance for more details.
Continue Reading…