rt,请问在这一题中 spfa 的队列中是否最多只会有 2×n×n 个元素?我手写队列的时候炸掉了,
class Que{
public:
int q[N];
int h;
int t;
inline void ini(){
h=1;
t=0;
return;
}
inline void pop(){
h++;
if(h==N)
h=1;
return;
}
inline void push(int x){
t++;
if(t==N)
t=1;
q[t]=x;
return;
}
inline int top(){
return q[h];
}
inline bool empty(){
return h>t;
}
}q;
其中 N=2*51*51
时 https://www.luogu.com.cn/record/222173116