String Decompression
InterviewTime limit1sMemory limit1024 MB
Given patterns mapped to uppercase letters and a compressed string, expand it and print characters S through E of the original string.
- Level
Medium6 of 10
- Topics
- String, Implementation, Recursion, Simulation
- Solved
- No attempts yet
Problem
There is a program called SPC (String Pattern Compressor) that compresses a specific lowercase string pattern into a single uppercase letter.
For example, when compression is done as follows, “” is compressed into “”.
Given a compression program and a compressed string, write a program that outputs part of the string before compression.
Input
The first line gives the number of compression methods . ()
From the second line, lines follow, each containing a lowercase string pattern and the corresponding uppercase letter, separated by a space. The length of each lowercase string pattern does not exceed , and the same uppercase letter is not given more than once.
The -th line gives the compressed string. The length of the compressed string does not exceed .
The last line gives two integers and . ( (length of the string before compression))
Output
Output the -th character through the -th character of the string before compression.