AcWing 852. spfa判断负环
#include <bits/stdc++.h>
using namespace std;
const int N = 2005, M = 10005;
int head[N], cnt;
int n, m;
int dis[N], backup[N];
int step[N]; //到当前点最短路径跳转的步数
bool st[N];
struct
{
int v, w;
int nxt;
} edges[M];
int spfa()
{
memset(dis, 0x3f, sizeof dis);
memset(st, 0, sizeof st