排序:
默认
按更新时间
按访问量

B - Fishmonger(dfs+剪枝)

A fishmonger wants to bring his goods from the port to the market. On his route he has to traverse an area with many tiny city states. Of course he h...

2018-01-25 13:43:56

阅读数:65

评论数:0

A - Fire Net (dfs)

Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or ...

2017-10-09 15:53:36

阅读数:147

评论数:0

J - Goblin Wars

J - Goblin Wars 题目大意:给出一幅图,’.’可以走,‘#’不能走,然后从‘a’—‘z’出发,如果只有一种字符可以到达(距离最短),则变成可以到达的字符,如果有多个字符可以到达,将其变为‘*’……#include <iostream> #include <cstdi...

2017-09-06 08:52:20

阅读数:176

评论数:0

J - Borg Maze(BFS+Prim)

The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe ...

2017-09-04 20:39:42

阅读数:128

评论数:0

B - The Accomodation of Students (二分图染色判断+匈牙利算法)

There are a group of students. Some of them may know each other, while others don’t. For example, A and B know each other, B and C know each other. B...

2017-08-23 20:56:58

阅读数:158

评论数:0

二分图的判断--染色

怎样判断一个图是否为二分图? 很简单,用染色法,即从其中一个顶点开始,将跟它邻接的点染成与其不同的颜色,如果邻接的点有相同颜色的,则说明不是二分图,每次用bfs遍历即可。判断二分图方法: 用染色法,把图中的点染成黑色和白色。 首先取一个点染成白色,然后将其相邻的点染成黑色,如果发现有相邻且同...

2017-08-23 20:09:34

阅读数:183

评论数:0

魔戒(四维bfs)

魔戒 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Discuss Problem Description蓝色空间号和万有引力号进入了四维水洼,发现了四维物体–魔戒。 这里我们把飞船和魔戒都抽象为四维空间中的一个点,分别...

2017-08-16 19:16:53

阅读数:162

评论数:0

5-7 六度空间 (bfs)

5-7 六度空间 (30分) “六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图1所示。 ...

2017-08-14 17:34:55

阅读数:133

评论数:0

5-6 列出连通集

5-6 列出连通集 给定一个有NN个顶点和EE条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N-1N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。输入格式:输入第1行给出2个整数NN(0#include <stdio.h>...

2017-08-14 16:22:15

阅读数:95

评论数:0

H - A计划(bfs)

可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。 现据密探所报,公主...

2017-08-10 11:47:12

阅读数:112

评论数:0

哈密顿绕行世界问题(dfs)

Problem Description 一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input 前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1....

2017-08-10 08:57:52

阅读数:183

评论数:0

I - Fire!(广度优先搜索+优先队列)

Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Hel...

2017-08-09 16:03:02

阅读数:143

评论数:0

F - Prime Path (bfs)

The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit roo...

2017-08-09 11:21:44

阅读数:171

评论数:0

E - Fire Game (两点bfs)

Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is co...

2017-08-09 10:24:23

阅读数:93

评论数:0

非常可乐(bfs)

大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)...

2017-08-08 21:27:45

阅读数:1240

评论数:0

K - Oil Deposits

The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of...

2017-08-08 11:57:28

阅读数:102

评论数:0

迷宫问题(bfs)+结构体

定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0, };它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找...

2017-08-07 19:28:37

阅读数:115

评论数:0

H - Find a way(两次bfs)

H - Find a wayPass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet...

2017-08-07 17:16:11

阅读数:169

评论数:0

D - Find The Multiple(dfs)

Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You ...

2017-08-07 15:42:13

阅读数:121

评论数:0

B - Dungeon Master

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock...

2017-08-06 17:38:30

阅读数:536

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭