本来想手打队列的
```cpp
template <typename T,const size_t size_>
struct queue{
//队首位置
int _front;
//队尾位置
int _back;
//数据
T _data[size_];
queue(){
_front=0;
_back=0;
memset(_data,0,sizeof _data);
}
//获取队列当前元素个数
inline int size(){
return (_back-_front);
}
//入队
inline bool push(T data){
if(_back+1>size_) return 0;
_data[_back++]=data;
}
//出队
inline bool pop(){
if(size()==0)return 0;
_front++;
return 1;
}
//获取队尾元素
inline T back(){
return _data[_back-1];
}
//获取队首元素
inline T front(){
return _data[_front];
}
//判断是否是空队列
inline bool empty(){
return (!size());
}
//清空
inline void clear(){
_front=0;
_back=0;
memset(_data,0,sizeof _data);
}
};
queue <status,100000> q;
```
by middle_set @ 2017-11-25 11:03:20
stl 有deque,不用手打
by cszmc2004 @ 2017-11-25 11:10:30
@[newworld](/space/show?uid=35490) 然鹅求教如何改正
顺便AC150祭
by middle_set @ 2017-11-25 11:16:07
惊现wf大佬
@[hiuseues](/space/show?uid=47842)
by Dilute @ 2017-11-25 15:00:32
@[hiuseues](/space/show?uid=47842) 我太菜了,不知道如何改正
但是你可以用最短路来ac这道题
by cszmc2004 @ 2017-11-25 18:57:58