图
文章平均质量分 61
ryo_218
要努力成为别人的依赖呀!
展开
-
PAT 1003 Emergency (25)
1003 Emergency (25)(25 分) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue t...原创 2018-08-30 21:50:43 · 229 阅读 · 0 评论 -
第八届蓝桥杯模拟赛 滑动解锁
题目:滑动解锁 滑动解锁是智能手机一项常用的功能。你需要在3x3的点阵上,从任意一个点开始,反复移动到一个尚未经过的"相邻"的点。这些划过的点所组成的有向折线,如果与预设的折线在图案、方向上都一致,那么手机将解锁。 所谓两个点“相邻”:当且仅当以这两个点为端点的线段上不存在尚未经过的点。 此外,许多手机都约定:这条折线还需要至少经过4个点。 为了描述方便,我们给这9个点从上到下、从左到右依...原创 2019-03-19 15:45:21 · 790 阅读 · 0 评论 -
第九届蓝桥杯省赛C++B组 全球变暖
标题:全球变暖 你有一张某海域NxN像素的照片,"."表示海洋、"#"表示陆地,如下所示: ........##.....##........##...####....###........ 其中"上下左右"四个方向上连在一起的一片陆地组成一座岛屿。例如上图就有2座岛屿。 由于全球变暖导致了海面上升,科学家预测未来几十年,岛屿边缘一个像素的范围会被海水淹没。具体来说如果一块陆地像素与海...原创 2018-04-04 22:07:57 · 3280 阅读 · 19 评论 -
PAT 1111 Online Map (30)
1111 Online Map (30)(30 分) Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the o...原创 2018-09-06 21:35:43 · 142 阅读 · 0 评论 -
PAT 1087 All Roads Lead to Rome (30)
1087 All Roads Lead to Rome (30)(30 分) Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most...原创 2018-09-06 18:10:38 · 267 阅读 · 0 评论 -
PAT 1150 Travelling Salesman Problem (25)
1150 Travelling Salesman Problem (25) (25 分) The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest...原创 2018-09-09 21:11:28 · 153 阅读 · 0 评论 -
PAT 1030 Travel Plan (30)
1030 Travel Plan (30)(30 分) A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler ...原创 2018-09-02 20:21:58 · 115 阅读 · 0 评论 -
PAT 1018 Public Bike Management (30)
1018 Public Bike Management (30)(30 分) There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and...原创 2018-09-02 16:45:42 · 135 阅读 · 0 评论 -
图的整理与总结
1.dijkstra算法 ①求从source到destination的最短路径(最短距离、最短路径条数、最短路径上的节点数以及路径) ②若最短路径不唯一,则再求从source到destination的最小代价 ③若最短路径还是不唯一,则再求从source到destination的最大节点权值和 #include <cstdio> #include <cstdlib>...原创 2018-09-07 22:31:19 · 172 阅读 · 0 评论 -
PAT 1013 Battle Over Cities (25)
1013 Battle Over Cities (25)(25 分) It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed...原创 2018-09-01 17:20:37 · 114 阅读 · 0 评论 -
PAT 1034 Head of a Gang (30)
1034 Head of a Gang (30)(30 分) One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is related. The weight ...原创 2018-09-04 13:24:32 · 120 阅读 · 0 评论 -
第八届蓝桥杯国赛C++B组 发现环
标题:发现环 小明的实验室有N台电脑,编号1~N。原本这N台电脑之间有N-1条数据链接相连,恰好构成一个树形网络。在树形网络上,任意两台电脑之间有唯一的路径相连。 不过在最近一次维护网络时,管理员误操作使得某两台电脑之间增加了一条数据链接,于是网络中出现了环路。环路上的电脑由于两两之间不再是只有一条路径,使得这些电脑上的数据传输出现了BUG。 为了恢复正常传输。小明需要找到所有在环路上的电脑...原创 2019-03-21 11:16:28 · 873 阅读 · 5 评论