
bfs
文章平均质量分 83
方品
fangpin.github.io
展开
-
eoj1857
push! Time Limit:1000MSMemory Limit:30000KB Total Submit:124Accepted:67 Description Mr. Schwarz was a famous powerful pro wrestler. He starts a part time job as a warehouseman. His task原创 2014-12-06 23:23:59 · 892 阅读 · 0 评论 -
1780
Escape Time Limit:3000MSMemory Limit:65536KB Total Submit:279Accepted:108 Description You find yourself trapped in a large rectangular room, made up of large square tiles; some are acc原创 2014-12-06 23:21:39 · 1008 阅读 · 0 评论 -
EOJ1839
恶魔之城(数据结构) Time Limit:1000MSMemory Limit:30000KB Total Submit:376Accepted:152 Special Judge Description 小强生日就要到了,partychen为了送给小强一个特别的礼物,决定到恶魔之城去偷走他们的镇城之宝--月亮之石.partychen已经从江湖百晓生处得到了恶魔之城原创 2014-12-06 23:22:56 · 1423 阅读 · 0 评论 -
EOJ1124 bfs
一天,sunny不小心进入了一个迷宫,不仅很难寻找出路,而且有的地方还有怪物,但是sunny有足够的能力杀死怪物,但是需要一定的时间,但是sunny想早一点走出迷宫,所以请你帮助他计算出最少的时间走出迷宫,输出这个最少时间.我们规定每走一格需要时间单位1,杀死怪物也需要时间1,如果不能走到出口,则输出impossible.每次走只能是上下左右4个方向. Input 每次首先2个数n原创 2014-12-06 23:19:21 · 850 阅读 · 0 评论 -
EOJ1646 bfs
Prime Path Time Limit:1000MSMemory Limit:65536KB Total Submit:68Accepted:40 Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating t原创 2014-12-06 23:20:30 · 772 阅读 · 0 评论 -
eoj2521
Guarding the Farm Time Limit:2000MSMemory Limit:65536KB Total Submit:124Accepted:48 Description The farm has many hills upon which Farmer John would like to place guards to ensure the sa原创 2014-12-06 23:26:25 · 969 阅读 · 0 评论 -
EOJ 1816 判断图连通的三种方法——dfs,bfs,并查集
题目:eoj1816 题目分析:判断图是否连通,可用dfs遍历图算法。这里我采用的是并查集的方法。初始化时将每个节点看作一个集合,则每给出一条边即把两个集合合并。最后遍历所有点,有几个集合便有几个连通分量,若只有一个集合说明图连通。 AC代码: #include #include #include #include #include #include原创 2014-12-24 18:42:39 · 7010 阅读 · 3 评论 -
poj1915 简单bfs
Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him canmove knights from one position to another so fast. Can you beat him? The Problem Your task is to write原创 2014-12-29 17:36:16 · 826 阅读 · 0 评论