求问这个代码为什么会 CE 啊...
C++ 的语法怎么这么申必
#include <bits/stdc++.h>
const int maxn = 5005;
const int inf = 0x3f3f3f3f;
struct E {
int nxt, to, w;
} e[maxn << 2];
int head[maxn], cnt, n, m, dis[maxn], num[maxn];
bool vis[maxn];
queue<int> q;
void addedge(int u, int v, int w) {
e[++ cnt].to = v;
e[cnt].w = w;
e[cnt].nxt = head[u];
head[u] = cnt;
}
bool Shortest_Path_Fast_Algorithm(int x) {
dis[x] = 0, q.push(x), vis[x] = true, num[x]++;
while(!q.empty()) {
int u = q.front(); q.pop();
vis[u] = false;
for (int i = head[u]; i != 0; i = e[i].nxt)
if (dis[e[i].to] > dis[u] + e[i].w) {
dis[e[i].to] = dis[u] + e[i].w;
if (!vis[e[i].to]) {
q.push(e[i].to);
vis[e[i].to] = true;
num[e[i].to]++;
if (num[e[i].to] == n + 1) return false;
}
}
} return true;
}
int main() {
scanf("%d%d", &n, &m);
memset(dis, inf, sizeof dis);
for(int i = 1, opt, u, v, w; i <= n; i ++) {
scanf("%d", &opt);
if(opt == 1) {
scanf("%d%d%d", &u, &v, &w);
addedge(u, v, - w);
} else if(opt == 2) {
scanf("%d%d%d", &u, &v, &w);
addedge(v, u, w);
} else {
scanf("%d%d%d", &u, &v);
addedge(u, v, 0), addedge(v, u, w);
}
} for(int i = 1; i <= n; i ++) addedge(n + 1, i, 0);
if(Shortest_Path_Fast_Algorithm(n + 1)) puts("No");
else puts("Yes");
}
9 1 C:\Users\lenovo\Documents\未命名4.cpp [Error] 'queue' does not name a type