N people, with ID numbers 1, 2, …, N, are lining up in front of a bank. There will be Q events. The following three kinds of events can happen. 1 : The teller calls the person with the smallest ID number who has not been called. 2 x : The person with the ID number x comes to the teller for the first time. (Here, person x has already been called by the teller at least once.) 3 : The teller again calls the person with the smallest ID number who has already been called but has not come. Print the ID numbers of the people called by the teller in events of the third kind翻译
时间: 2023-05-11 13:04:14 浏览: 103
:N个人,编号为1、2、...、N,排队在银行前面。将会有Q个事件发生。以下三种事件可能发生。1:出纳员叫号码最小且未被叫过的人。2 x:编号为x的人第一次来到出纳员处。(这里,人x已经被出纳员叫过至少一次。)3:出纳员再次叫号码最小且已被叫过但未到的人。打印出第三种事件中被出纳员叫到的人的编号。
阅读全文