威武河马

文章
6
资源
0
加入时间
3年0月20天

小组队列-------------------------思维(队列)

解析:先开一个数组专门记录编号的开两个队列。一个存储编号为x的队列存的数,一个存储编号(方便得知哪个编号在前)对于插入操作:找出数x的编号pos,把x放到编号为pos的队列中,然后编号pos放到编号队列中对于出队操作:找出编号队列中队头元素为pos ,那么编号为pos的队列出队一个元素。如果编号为pos的队列为空,那么编号队列就要删除该编号(出队)#include<bits/stdc++.h>using namespace std;const int N=1e6+10

HDU 2604 Queuing

Problem DescriptionQueues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch