poj 1281 MANAGER

来源:互联网 发布:淘宝上的人参能吃吗 编辑:程序博客网 时间:2024/04/30 10:34

题意:进程管理,这里提供几种操作

 

  • 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 的值进行排序

具体见代码:

 

原创粉丝点击