
图
小·幸·运
你的所有努力最后都会回赠予你。
展开
-
PAT甲级A1003 Emergency (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 teams in each city and the l...原创 2018-07-18 22:31:47 · 295 阅读 · 0 评论 -
PAT甲级A1122 Hamiltonian Cycle (25 分)
The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle".In this problem, you are supposed to tell if a given cycle ...原创 2019-03-08 12:43:48 · 251 阅读 · 0 评论 -
PAT甲级A1154 Vertex Coloring (25 分)
A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at most k colors is called a (proper) k...原创 2019-03-16 15:48:20 · 327 阅读 · 0 评论 -
PAT甲级A1134 Vertex Cover (25 分)
A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with several vertex sets, you are supposed to tell if e...原创 2019-03-10 19:55:59 · 228 阅读 · 0 评论 -
PAT甲级A1131 Subway Map (30 分)
In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help people with you...原创 2019-03-10 15:58:34 · 305 阅读 · 0 评论 -
PAT甲级A1142 Maximal Clique (25 分)
A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extended by including one more adj...原创 2019-03-13 21:46:28 · 183 阅读 · 0 评论 -
PAT甲级A1111 Online Map (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 other is the fastest. It is g...原创 2019-02-28 15:53:12 · 284 阅读 · 0 评论 -
PAT甲级A1076 Forwards on Weibo (30 分)
Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a ...原创 2019-02-18 16:25:01 · 147 阅读 · 0 评论 -
PAT甲级A1087 All Roads Lead to Rome (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 happiness.Input Specification:Each ...原创 2019-02-21 21:25:59 · 375 阅读 · 0 评论 -
PAT甲级A1072 Gas Station (30 分)
A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the hou...原创 2019-02-15 15:41:43 · 165 阅读 · 0 评论 -
PAT甲级A1150 Travelling Salesman Problem(25 分)
1150 Travelling Salesman Problem(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 possi...原创 2018-09-09 11:20:46 · 799 阅读 · 0 评论 -
PAT甲级A1146 Topological Order(25 分)
1146 Topological Order(25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are suppo...原创 2018-09-05 22:04:57 · 789 阅读 · 0 评论 -
PAT甲级A1034 Head of a Gang (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 of a relation is defined to be t...原创 2018-08-24 21:17:37 · 168 阅读 · 0 评论 -
PAT甲级A1030 Travel Plan (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 to decide the shortest path b...原创 2018-08-18 20:31:46 · 165 阅读 · 0 评论 -
PAT甲级A1018 Public Bike Management (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 return it to any other stations in the ...原创 2018-08-06 22:21:03 · 263 阅读 · 0 评论 -
PAT甲级A1021 Deepest Root (25)
A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root ...原创 2018-08-09 22:20:38 · 153 阅读 · 0 评论 -
PAT甲级A1013 Battle Over Cities (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. We must know immediately if we nee...原创 2018-07-28 20:49:30 · 443 阅读 · 0 评论 -
PAT甲级A1139 First Contact (30 分)
Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly i...原创 2019-03-17 14:02:55 · 469 阅读 · 0 评论