
dfs深度搜索
coding__girl
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
uva 315 Network
A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines are bidi原创 2017-09-23 18:20:23 · 307 阅读 · 0 评论 -
UVA 10092 The Problem with the Problemsetter
The number of students interested to participate in this year’s Intra-BUET Programming Contest is huge. Since it is very difficult to accommodate such a large number of students in our labs, we have de原创 2017-11-15 22:08:39 · 561 阅读 · 0 评论 -
uva 10080 Gopher II【匈牙利算法】
The gopher family, having averted the canine threat, must face a new predator. The are n gophers and m gopher holes, each at distinct (x,y) coordinates. A hawk arrives and if a gopher does not reach a原创 2017-11-17 12:06:40 · 580 阅读 · 0 评论 -
UVA 10926 How Many Dependencies?
In this problem you will need to find out which task has the most number of dependencies. A task A depends on another task B if B is a direct or indirect dependency of A. For example, if A depends on原创 2017-10-03 14:45:14 · 288 阅读 · 0 评论 -
UVA 572 Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the原创 2017-10-03 14:06:34 · 243 阅读 · 0 评论 -
UVA 352 The Seasonal War
The inhabitants of Tigerville and Elephantville are engaged in a seasonal war. Last month, Elephantville successfully launched and orbited a spy telescope called the Bumble Scope. The purpose of the Bu原创 2017-10-02 17:15:09 · 480 阅读 · 0 评论 -
UVA 260 Il Gioco dell'X
题意: 黑白两方下棋,必有一人胜出,若黑棋能从第一行走到最后一行则Black胜出,若白棋能从能从第一列走到最后一列则White胜出 思路: 只需判断Black是否胜出,用dfs搜索黑棋能否能从第一行走到最后一行#include <iostream> using namespace std; int N,flag=0; int dx[]={1,0,1,0,-1,-1};//记录六个方向 int原创 2017-10-02 16:55:56 · 234 阅读 · 0 评论 -
UVA 469 Wetlands of Florida
A construction company owns a large piece of real estate within the state of Florida. Recently, the company decided to develop this property. Upon inspection of the property, however, it was revealed t原创 2017-10-02 15:55:16 · 725 阅读 · 0 评论 -
uva 10596 Morning Walk
Kamal is a Motashota guy. He has got a new job in Chittagong. So, he has moved to Chittagong from Dinajpur. He was getting fatter in Dinajpur as he had no work in his hand there. So, moving to Chittago原创 2017-10-02 14:20:53 · 209 阅读 · 0 评论 -
UVA 10452 Marcus
“First, the breath of God. Only the penitent man will pass. Second, the Word of God, Only in the footsteps of God will he proceed. Third, the Path of God, Only in the leap from the lion’s head wil原创 2017-09-24 12:30:34 · 569 阅读 · 0 评论 -
UVA 10336 Rank the Languages
You might have noticed that English and Spanish are spoken in many areas all over the world. Now it would be nice to rank all languages according to the number of states where they are spoken. You’re原创 2017-09-24 11:40:36 · 496 阅读 · 0 评论 -
uva 670 The dog task
匈牙利算法,将狗的兴趣点与人走的每段路作二部图(即图的左边是点,右边是边),求出该二部图对于狗的兴趣点的最大匹配数,再加上人必经的点数,就是狗的路线。#include <iostream> #include <cmath> #include <vector> #include <cstring> using namespace std; const int Maxn=105; int N,M; do原创 2017-11-16 10:37:13 · 217 阅读 · 0 评论