
PAT甲
文章平均质量分 90
PAT甲
Elephant_King
github:https://github.com/Elephant-King9
平时写的代码会上传到github,欢迎学习交流
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【题解】【PAT甲】甲级题目汇总(更新)
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020(后序中序转层序) 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 10原创 2021-12-21 11:11:51 · 501 阅读 · 0 评论 -
【题解】【PAT甲】1118 Birds in Forest (25 分)(并查集)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 scientists to count the maximum number of tree..原创 2021-12-17 16:39:13 · 238 阅读 · 0 评论 -
【题解】【PAT甲】1114 Family Property (25 分)(并查集)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we need to know the size of each family, and the ave..原创 2021-12-17 15:14:04 · 538 阅读 · 0 评论 -
【题解】【PAT甲】1107 Social Clusters (30 分)(并查集)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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. Asocial clusteris a set of people who have some of their hobbies in commo...原创 2021-12-17 11:24:26 · 242 阅读 · 0 评论 -
【题解】【PAT甲】1146 Topological Order (25 分)(拓扑排序)(剪枝)(测试点4)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 supposed to write a program to test each of the optio..原创 2021-12-16 19:34:18 · 608 阅读 · 0 评论 -
【题解】【PAT甲】1045 Favorite Color Stripe(30分)(动态规划)(最长不上升子序列)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 pieces and sewing the remaining parts together to form ..原创 2021-12-16 18:56:03 · 341 阅读 · 0 评论 -
【题解】【PAT甲】1043 Is It a Binary Search Tree(25分)(前序中序转后序)(两种解法)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node co..原创 2021-12-14 13:26:38 · 850 阅读 · 1 评论 -
【题解】【PAT甲】1020 Tree Traversals(25分)(后序中序转层序)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary ..原创 2021-12-14 11:15:40 · 1214 阅读 · 0 评论 -
【题解】【PAT甲】1064 Complete Binary Search Tree(30分)(BST)(完全二叉树)(中序转层序)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node co..原创 2021-12-14 10:47:13 · 318 阅读 · 0 评论 -
【题解】【PAT甲】1003 Emergency (25 分)(Dijkstra)(最短路径数量)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 length of each r...原创 2021-12-10 11:37:23 · 376 阅读 · 0 评论 -
【题解】【PAT甲】1072 Gas Station (30 分)(Dijkstra)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 houses are in its ...原创 2021-12-09 17:48:11 · 149 阅读 · 0 评论 -
【题解】【PAT甲】1076 Forwards on Weibo (30 分)(dfs 27分)(bfs 30分)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 with followers relat..原创 2021-12-09 16:22:54 · 418 阅读 · 0 评论 -
【题解】【PAT甲】1080 Graduate Admission (30 分)(测试点3)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure. Each ..原创 2021-12-09 15:34:31 · 349 阅读 · 0 评论 -
【题解】【PAT甲】1089 Insert or Merge (25 分)(排序)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 According to Wikipedia: Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the locatio...原创 2021-12-09 11:41:24 · 110 阅读 · 0 评论 -
【题解】【PAT甲】1098 Insertion or Heap Sort (25 分)(排序)(测试点4)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 According to Wikipedia: Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the locatio...原创 2021-12-09 11:04:03 · 381 阅读 · 0 评论 -
【题解】【PAT甲】1091 Acute Stroke (30 分)(dfs 27分)(bfs 30分)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 MRI slice, your job is to calculate the volum..原创 2021-12-08 20:56:56 · 468 阅读 · 0 评论 -
【题解】【PAT甲】1155 Heap Paths (30 分)(堆)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 In computer science, aheapis 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 greater than or equal to (in a max heap) or l...原创 2021-12-08 17:40:38 · 131 阅读 · 0 评论 -
【题解】【PAT甲】1153 Decode Registration Card of PAT (25 分)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, namely,Tfor the top level,Afor advance andBfor basic; the 2nd - 4th digits are the test site number, ranged from 1...原创 2021-12-08 17:04:39 · 236 阅读 · 0 评论 -
【题解】【PAT甲】1148 Werewolf - Simple Version (20 分)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game, player #1 said: "Player #2 is a werewolf."; player #2 said: "Player #3 is a ..原创 2021-12-08 14:51:31 · 692 阅读 · 0 评论 -
【题解】【PAT甲】1147 Heaps (30 分)(堆)
题目链接 题目描述 题目大意 解题思路 题解原创 2021-12-08 12:00:01 · 588 阅读 · 0 评论 -
【题解】【PAT甲】1143 Lowest Common Ancestor (30 分)(树)(BST)(最近公共祖先)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 defined as a binary tree which has the following p...原创 2021-12-08 10:28:28 · 413 阅读 · 0 评论 -
【题解】【PAT甲】 1139 First Contact (30 分)(测试点1,2,3,4,5)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 in the first place...原创 2021-12-07 12:10:05 · 1366 阅读 · 0 评论 -
【题解】【PAT甲】 1135 Is It A Red-Black Tree (30 分)(红黑树)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 There is a kind of balanced binary search tree namedred-black treein the data structure. It has the following 5 properties: (1) Every node is either red or black. (2) The root is black. (3) Every leaf (NULL) is...原创 2021-12-06 21:04:38 · 386 阅读 · 0 评论 -
【题解】【PAT甲】1131 Subway Map (30 分)(dfs)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 your computer skills!..原创 2021-12-06 19:13:19 · 492 阅读 · 0 评论 -
【题解】【PAT甲】 1129 Recommendation System (25 分)(set重构)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user's preference by the number of times that an item ...原创 2021-12-06 16:45:22 · 252 阅读 · 0 评论 -
【题解】【PAT甲】1128 N Queens Puzzle (20 分)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 The "eight queens puzzle" is the problem of placing eight chess queens on an8×8chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, column, or diag...原创 2021-12-06 15:40:59 · 172 阅读 · 0 评论 -
【题解】【PAT甲】1111 Online Map (30 分)(Dijkstra)
题目链接 PTA | 程序设计类实验辅助教学平台 题目描述 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 guaranteed that ...原创 2021-12-06 14:56:49 · 147 阅读 · 0 评论