![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
NullObjectError
这个作者很懒,什么都没留下…
展开
-
1126 Eulerian Path (25 分)--PAT甲级
1126 Eulerian Path (25 分)In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which starts and ends on the s...原创 2019-01-18 13:47:11 · 406 阅读 · 0 评论 -
1072 Gas Station (30 分)--PAT甲级
1072 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 gu...原创 2019-01-26 20:50:52 · 805 阅读 · 0 评论 -
1151 LCA in a Binary Tree (30 分)--PAT甲级
1151 LCA in a Binary Tree (30 分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you are...原创 2019-01-21 20:38:14 · 547 阅读 · 0 评论 -
1118 Birds in Forest (25 分)--PAT甲级
1118 Birds in Forest (25 分)Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the ...原创 2019-01-16 14:02:50 · 238 阅读 · 0 评论 -
1143 Lowest Common Ancestor (30 分)--PAT甲级
1143 Lowest Common Ancestor (30 分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively d...原创 2019-01-22 14:47:37 · 371 阅读 · 1 评论 -
1018 Public Bike Management (30 分)--PAT甲级
1018 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 retu...原创 2019-01-28 15:26:44 · 157 阅读 · 0 评论 -
1076 Forwards on Weibo (30 分)--PAT甲级
1076 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 wit...原创 2019-01-28 16:24:23 · 397 阅读 · 0 评论 -
1091 Acute Stroke (30 分)--PAT甲级
1091 Acute Stroke (30 分)One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MR...原创 2019-02-02 21:20:24 · 258 阅读 · 0 评论 -
1131 Subway Map (30 分)--PAT甲级
1131 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 ...原创 2019-01-28 21:46:45 · 1349 阅读 · 2 评论 -
1034 Head of a Gang (30 分)--PAT甲级
1034 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 ...原创 2019-01-29 15:22:27 · 963 阅读 · 0 评论 -
1095 Cars on Campus (30 分)--PAT甲级
1095 Cars on Campus (30 分)Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the i...原创 2019-01-29 16:56:44 · 1336 阅读 · 0 评论 -
1021 Deepest Root (25 分)--PAT甲级
1021 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 h...原创 2019-02-23 14:53:13 · 919 阅读 · 3 评论 -
1029 Median (25 分)--PAT甲级
1029 Median (25 分)Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9, ...原创 2019-02-23 16:00:27 · 519 阅读 · 0 评论 -
1045 Favorite Color Stripe (30 分)--PAT甲级
1045 Favorite Color Stripe (30 分)Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pie...原创 2019-01-31 15:24:46 · 149 阅读 · 0 评论 -
1087 All Roads Lead to Rome (30 分)--PAT甲级
1087 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 happ...原创 2019-01-26 15:43:45 · 563 阅读 · 0 评论 -
1155 Heap Paths (30 分)--PAT甲级
1155 Heap Paths (30 分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either grea...原创 2019-01-21 19:16:17 · 168 阅读 · 1 评论 -
1127 ZigZagging on a Tree (30 分)--PAT甲级
1127 ZigZagging on a Tree (30 分)Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal se...原创 2019-01-18 14:44:17 · 1146 阅读 · 0 评论 -
1123 Is It a Complete AVL Tree (30 分)--PAT甲级
1123 Is It a Complete AVL Tree (30 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they d...原创 2019-01-23 18:57:32 · 542 阅读 · 0 评论 -
1130 Infix Expression (25 分)--PAT甲级
1130 Infix Expression (25 分)Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Specificat...原创 2019-01-18 22:10:37 · 235 阅读 · 0 评论 -
1111 Online Map (30 分)--PAT甲级
1111 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 ...原创 2019-01-24 17:10:22 · 846 阅读 · 0 评论 -
1030 Travel Plan (30 分)--PAT甲级
1030 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 de...原创 2019-01-24 18:58:34 · 136 阅读 · 0 评论 -
1136 A Delayed Palindrome (20 分)--PAT甲级
1136 A Delayed Palindrome (20 分)Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0≤ai<10 for all i and ak>0. Then N is palindromic...原创 2019-01-19 22:17:20 · 174 阅读 · 0 评论 -
1138 Postorder Traversal (25 分)--PAT甲级
1138 Postorder Traversal (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first numb...原创 2019-01-20 14:21:49 · 184 阅读 · 0 评论 -
1145 Hashing - Average Search Time (25 分)--PAT甲级
1145 Hashing - Average Search Time (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys...原创 2019-01-20 18:20:56 · 141 阅读 · 0 评论 -
1146 Topological Order (25 分)--PAT甲级
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...原创 2019-01-20 18:55:46 · 237 阅读 · 0 评论 -
1152 Google Recruitment (20 分)--PAT甲级
1152 Google Recruitment (20 分)In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL con...原创 2019-01-20 21:06:18 · 385 阅读 · 0 评论 -
1022 Digital Library (30 分)--PAT甲级
1022 Digital Library (30 分)A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigne...原创 2019-01-25 15:55:45 · 273 阅读 · 0 评论 -
1107 Social Clusters (30 分)--PAT甲级
1107 Social Clusters (30 分)When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of ...原创 2019-01-25 17:08:30 · 341 阅读 · 0 评论 -
2019-PAT春季考试小结
第一次参加pat考试,大概准备了一两个月这样,主要还是参考算法笔记,然后就是狂刷模拟题,各种题型都熟悉一遍(个人感觉二叉树的建树、并查集、dfs、dijkstra比较重要一点)。进入考场后直到1点半老师才让我们动鼠标,我先试试IDE,codeblocks不知为什么找不到编译器路径,心态有点崩,最后用了dev,建议各位把考场有的ide都熟悉一下。先把字体调成自己喜欢的加上各种头文件开始答题了。第一...原创 2019-03-03 14:56:46 · 1267 阅读 · 0 评论