Задача 9 от Stacks and Queues
Здравейте на тази задача имам 70 точки в Judge ,възможно ли е да я погледнете .
Problem 9. Simple Text Editor
You are given an empty text. Your task is to implement 4 commands related to manipulating the text
- 1 someString - appends someString to the end of the text
- 2 count - erases the last count elements from the text
- 3 index - returns the element at position index from the text
- 4 - undoes the last not undone command of type 1 / 2 and returns the text to the state before that operation
Input
- The first line contains n, the number of operations.
- Each of the following n lines contains the name of the operation followed by the command argument, if any, separated by space in the following format CommandName Argument.
Output
- For each operation of type 3 print a single line with the returned character of that operation.
Constraints
- 1 ≤ N ≤ 105
- The length of the text will not exceed 1000000
- All input characters are English letters.
- It is guaranteed that the sequence of input operation is possible to perform.
Благодаря много , и 90 точки е добре .