Home > Back-end >  Great god strives for the process
Great god strives for the process

Time:03-22

Please develop a program that will be made by N (2 N 100) or less the essence of sequence X output to the result of the "location change information",
Transposition ways as follows, for example, 10 integers X series and location change information as follows:

X series:

Position 0 1 2 3 4 5 6 7 8 9
Price 3, 81 9 0-9 of 12 36 33 91 10

Transposition of information: 3 - & gt; 8 - & gt; 0 - & gt; 9 - & gt; 3
(a position change information, the number of the range is 0 to N - 1
In a given location information, the first and the last position is always the same,
In addition to don't have the same position,)

Change according to the above order information, from the sequence X
No. 3 position of integer "12" move to the location, 8
8 digits "91" moves to 0,
0 "3" move to the position of integer 9 position,
9 "10" move to the position of integer 3 position,

Above formed by the transformation rules of the sequence is as follows,

Position 0 1 2 3 4 5 6 7 8 9
Price 91 81 9 10 0-9 36 33 12 3

Transform the sequence of the output in one line, but the output in the line of the front of a blank,

The input sample 1
10? The input sequence length (N)
3, 81 9 12 0-9 36 33 91 10? Sequence X
May modify the length of sequence information
3 8 0 9 3 about replacing order

Power example 1
91 81 9 10 0-9 36 33 12 3? Transform series

The input sample 2
6
0 20 to 40 30 10 to 50
4
1 4 2 1

The output sample 2
0 to 10 20 30 to 40 to 50
  • Related