图
有关于图的相关算法题
醉酒诗人
每逢大事有静气
展开
-
【PAT】A1076 Forwards on Weibo (30分)(图的遍历bfs)
1076 Forwards on Weibo (30分)题目链接法一:邻接矩阵法#include<iostream>#include<queue>using namespace std;const int maxn = 1010;int Graph[maxn][maxn] = {0};int n, l; //邻接矩阵版本 struct Node{...原创 2020-03-25 12:30:51 · 986 阅读 · 0 评论 -
【PAT】A1034 Head of a Gang (30分)(图的遍历dfs)
1034 Head of a Gang (30分)题目链接思路:图的深搜。#include<iostream>#include<map>#include<cstring>#include<algorithm>using namespace std;const int maxn = 2005;const int inf = 0x3...原创 2020-03-24 22:11:07 · 140 阅读 · 0 评论 -
杭电oj1874:畅通工程续(最短路径)
1874 畅通工程续题目链接Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。每组数据...原创 2020-03-15 18:15:54 · 333 阅读 · 0 评论 -
杭电oj1045:Fire Net(深度优先搜索dfs)
Fire Net链接Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18352 Accepted Submission(s): 11191Problem DescriptionSuppose that we have a ...原创 2020-01-25 20:38:33 · 247 阅读 · 1 评论 -
杭电oj1312:Red and Black
Red and Black链接Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33213 Accepted Submission(s): 20143Problem DescriptionThere is a rectang...原创 2020-01-23 23:57:26 · 286 阅读 · 0 评论 -
杭电oj1241:Oil Deposits
Oil Deposits链接Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 57905 Accepted Submission(s): 33183Problem DescriptionThe GeoSurvComp geo...原创 2020-01-23 22:53:29 · 315 阅读 · 0 评论