题意:进程管理,这里提供几种操作
- a x - add to the queue the process with the cost x;
- r - remove a process, if possible, from the queue according to the current manager policy;
- p i - enforce the policy i of the manager, where i is 1 or 2. The default manager policy is 1
- e - ends the list of requests.
思路:用一维数组模拟该过程即可,没什么难度,在进行r操作时,可根据p i 的值进行排序
具体见代码: