Please read the new rule regarding the restriction on the use of AI tools. ×

Someone please help me =((

Revision en4, by DPlayerGod, 2022-04-26 03:19:08

Hope someone will be able to give me an idea about this problem :

John has N movie discs placed in a stack, which are numbered 1, 2 ... n from the top. For every time he takes a disc, John will skillfully pull the disc he wants to watch from the stack. And after using it later, he put this plate on top again, messing up the order. Now he has m discs to watch in turn, where on the stack he wants to watch it each time he watches the ith disc ? ****

Sample Input

5 3
4 4 5

Sample Output

4 1 5 

Note : n, m <= 1e5.

Thank you so much!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en6 English DPlayerGod 2022-04-26 03:22:10 0 (published)
en5 English DPlayerGod 2022-04-26 03:20:42 10
en4 English DPlayerGod 2022-04-26 03:19:08 521
en3 English DPlayerGod 2022-04-26 03:06:59 21 Tiny change: 'PTIT122K/)' -> 'PTIT122K/).Thank you so much!'
en2 English DPlayerGod 2022-04-26 03:05:57 25 Tiny change: 'roblem : [Your text to link here...](https://' -> 'roblem : [](https://'
en1 English DPlayerGod 2022-04-26 03:04:06 164 Initial revision (saved to drafts)