subject

Salut ma puteti ajuta cu problema asta ? Date de intrare:
Pe prima linie se află două numere, N și M.

Pe următoarele linii se află N numere naturale, numerele de identificare a foilor aflate inițial pe masă(primul număr este asociat primei foi, al doilea număr este asociat celei de-a doua foi…).
Pe următoarele M linii se află operațiile ce trebuie făcute:

1 dacă trebuie extrasă prima foaie
2, urmat de o valoare X, dacă trebuie introdusă o nouă foaie la sfârșit, aceasta având numărul de identificare X.
Date de ieșire

Pe prima linie se va afișa numărul de foi rămase pe biroul lui Andrei în urma executării celor M operații, iar pe a doua linie, numerele de identificare ale acestora.
Restricții

1 ≤ N ≤ 900 000
1 ≤ M ≤ 400 000
Numerele de identificare sunt cuprinse intre 0 și 10 000
Dacă șirul nu mai conține niciun element și trebuie efectuată o operație de tip 1, operația nu va fi efectuată.

Exemplu
Date de intrare Date de ieșire
4 3 5
30 21 81 26 21 81 26 68 64
2 68
2 64
1

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:50
You are working as a security analyst in a company xyz that owns the whole subnet range of 23.0.0.0/8 and 192.168.0.0/8. while monitoring the data, you find a high number of outbound connections. you see that ip's owned by xyz (internal) and private ip's are communicating to a single public ip. therefore, the internal ip's are sending data to the public ip. after further analysis, you find out that this public ip is a blacklisted ip, and the internal communicating devices are compromised. what kind of attack does the above scenario depict?
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
When is it appropriate to use an absolute reference
Answers: 1
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
You have read about the beginnings of the internet and how it was created. what was the internet originally created to do? (select all that apply) share research. play games. communicate. share documents. sell toys
Answers: 1
You know the right answer?
Salut ma puteti ajuta cu problema asta ? Date de intrare:
Pe prima linie se află două numere,...
Questions