Counting suffixes

Please implement a data structure DD to efficiently support four operations:

Input

Input consists of several operations over an initially empty DD. Assume that each ss is made up of between 1 and 100 lowercase letters. At no moment the sum of the sizes of the strings stored in DD will be larger than 10610^6.

Output

Print the result of each C ss operation, and three dashes for each R operation.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T12:17:14.793Z

© Jutge.org, 2006–2026.
https://jutge.org