HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Data Structures > problem:


50429 - Secret Message

Guest
• Review clarifications (1)

Volume problems

• 50805 - Sum of the weights in a BST
• 50712 - Moon algebra
• 50675 - Kruja Boys
• 50415 - The Scientist
• 50679 - Jetpack Hurdle Jumping
• 50717 - Hurdle Jumping
• 50421 - Repairing road segments
• 50431 - Sultan's Game
• 50429 - Secret Message
• 50818 - Depth Limited BST
• 50836 - Censored
• 50505 - kht Puzzle
• 50840 - Tanker trucks
• 50877 - Friendly Queue
• 50876 - He is my cousin
• 50997 - Dynamic Knights
• 50490 - Across the River

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Halil Karimis.

Secret Message

Question: There are two friends who want to send short secret messages to each other. They found a special coding system which can be solved only by these two boys.

The system: There is a string of characters. There is a special role of "*" sign which removes the previous letter in the string, k "*" signs remove k previous letters.

Solution: There are two strings 'E' and 'D'.'E' is the given encrypted text line. The program should check 'E' so that if next element of 'E' is not '*' then writes the element into decrypted 'D', if not than remove the last element of 'E' without adding the '*' sign.

Input specification
There is one line of text which can contain any letters and symbols. Maximum length of text can be 255 characters.

Output specification
Print the secret message without any '*' characters.

 Sample Input I     Sample Input II   
 mx*erw*ho*abe*a
 lok*okl* u*ay*t t*tho*p*e e*sku*y
 Sample Output I     Sample Output II   
 merhaba
 look at the sky


Для отправки решений необходимо выполнить вход.

www.contester.ru