MAIN Home Schedule Rules Compile PROBLEMS Novice Veteran All |
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.
Consider the string AAAABCCCCCDDDD consisting of alphabetic characters only. This string is of length 14. Since the string consists of alphabetic characters only, duplicate characters can be removed and replaced with a duplication factor n. With this technique the string can be compressed and represented by 4AB5C4D. The compressed string is of length 7. Write a program which takes a string in compressed form and recreates the original uncompressed string.
InputInput will be a series of lines with one string per line. There will be only uppercase letters and digits in the string. All digits are compression counts. There will never be two digits in a row. You stop reading lines when you read a line with only a # on it. No input line will be longer than 50 characters.
OutputYou are to output one line for each line of input. The output should be the uncompressed version of the input line.
Sample Input
3A4B7D 2D7AC8FGD 2ABCDE #
Sample Output
AAABBBBDDDDDDD DDAAAAAAACFFFFFFFFGD AABCDE
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Test Data 0
3A4B7D 2D7AC8FGD 2ABCDE #
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Output for Test Data 0
AAAABBBBBDDDDDDDD DDDAAAAAAAACFFFFFFFFFGD AAABCDE
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Test Data 1
2Z8N4QM DGF8C5A7D ABRACADABRA 9Y3M2P #
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Output for Test Data 1
ZZZNNNNNNNNNQQQQQM DGFCCCCCCCCCAAAAAADDDDDDDD ABRACADABRA YYYYYYYYYYMMMMPPP
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Test Data 2
A 5H 2M4V9E #
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Output for Test Data 2
A HHHHHH MMMVVVVVEEEEEEEEEE
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Test Data 3
3ABCD4E2Z 9Q8W7E6R5T4YTREWQ4ASD3FG2HMN2B3VC4X5ZFG 5H5I #
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set. Output for Test Data 3
AAAABCDEEEEEZZZ QQQQQQQQQQWWWWWWWWWEEEEEEEERRRRRRRTTTTTTYYYYYTREWQAAAAASDFFFFGHHHMNBBBVVVVCXXXXXZZZZZZFG HHHHHHIIIIII
Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.
|
This page last updated Fri Feb 11 21:55:29 2000.