没有给初始状态做标记. 改成这样就好了 ```cpp memset(dp,0x3f,sizeof dp); dp[St]=0; vis[St]=1; //这里 queue<int>q; q.push(St); ``` by l1247396180 @ 2023-11-13 16:18:57