c数组包含负数,dis数组最长路初始化请用负无穷大而非 000 或 −1-1−1,例如
memset(dis, -0x3f, sizeof(dis));
此时dis赋值为 −1044266559-1044266559−1044266559