Submit | All submissions | Best solutions | Back to list |
EDIT1 - Editor |
Have you ever programmed in Brainf**k? If yes, then you know how annoying it is to press the same key several times in a row. So what we all need, is a good editor. Here are the functions that the editor should have:
- '\n': begin a new line. If the last line was empty, stop processing and print out all lines.
- 'd': copy all characters from the current line, and append them after the last character in this line. For example, if current line contains ab, and d is pressed two times, the result will be abababab
- any other character: append it to the current line.
Please note, that the solution may only be submitted in Brainf**k or Intercal.
Input
There is exactly one test case. You can assume, that there is no key press of 'd' when the line is still empty.
Output
Print the output that the editor described above would produce on the given input. You can assume, that no line is created with more than 150 characters.
Example
Input: sample-test
-dd-d-dd
end signalled by two newlines
Output: sample-test
--------------------------------------------
enen signalleenen signalle by two newlines
Added by: | Adrian Kuegel |
Date: | 2004-06-12 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | BF ICK |
Resource: | own problem |
hide comments
2013-04-15 21:31:15 (Tjandra Satria Gunawan)(曾毅昆)
@Mostafa 36a2 (Al3ayesh): You can find 40 more brainf**k problem on new updated TJANDRA page ;-) |
|
2012-12-29 16:21:45 Mostafa 36a2
Enjoy solving :) thank you (we need more BF problems here on spoj) |
|
2012-10-27 10:34:44 Riatre Foo
Hint: bff-1.0.3.1 uses 32bit cells. REALLY horrible for codes rely on wrapping. |
|
2010-12-19 05:30:17 Marwan
how can i terminate the input with 2 end lines ?? :D |