Implement an efficient data structure to keep a dynamic array
A[0..] of strings, with two operations:
‘I’
:
Increase the size of
by one (like A.push_back("");). Move every string at a
position
such that
one position to its right. Store the string
at the
-th
position, which now is empty.
‘C’
:
Print the
-th
character (0 based) of the whole array, considering the concatenation of
all its strings from left to right.
Input consists of just one case. Assume that each
has between 1 and 10 lowercase letters, each
is between 0 and the current number of strings, and each
is between 0 and the current number of characters minus one. The total
number of operations is at most
.
An ‘E’ marks the end of the input.
Print a line with the letter at the
-th
position for each ‘C’ operation.
Author: Salvador Roura
Generation: 2026-01-25T10:11:01.791Z
© Jutge.org, 2006–2026.
https://jutge.org