• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

对不起各位,我很久没有写博客了!

以后每周三周五更新,记得来看看!

-

01-BFS:在图论的最短路径中,有一类问题的边权只能是0或1。求最短路径长度。

所以BFS可以说是1-BFS,对吗

实现方法:

1.准备一个双头队列。

2.每次更新的时候,看看会不会是RELAX,如果是,会不会是RELAX

3.如果新的步骤号等于旧的步骤号,则放在前面,否则放在后面。

解释:

队列中的步数是7 7 7 8 8 8 8 8 8。

如果新的步骤数与原始步骤数相同,则为第一层(雾

所以放前面。

如果新的步数与原始步数不同,则为第二层(雾

所以把它放在后面。

(和dijsktra挺像的)

https://vjudge.net/contest/135733#problem/A

(莫名其妙的RE)

把代码给大家先写(博主已经被打死)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now