![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT甲级 (Advanced Level) Practic
文章平均质量分 86
要做小太阳
从小白到大白的进阶之路!
展开
-
PAT (Advanced Level) Practice 1001 A+B Format (20)(20 分)
编程题1001 A+B Format (20)(20 分)Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Inpu...原创 2018-06-15 19:29:28 · 139 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1090 Highest Price in Supply Chain (25 分)
编程题1090 Highest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer....原创 2018-11-09 10:04:23 · 109 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1094 The Largest Generation (25 分)
编程题1094 The Largest Generation (25 分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generat...原创 2018-11-09 10:21:55 · 109 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1102 Invert a Binary Tree (25 分)
编程题1102 Invert a Binary Tree (25 分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboar...原创 2018-11-09 10:27:59 · 148 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1106 Lowest Price in Supply Chain (25 分)
编程题1106 Lowest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer....原创 2018-11-09 10:57:28 · 172 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1115 Counting Nodes in a BST (30 分)
编程题1115 Counting Nodes in a BST (30 分)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 key...原创 2018-11-09 11:01:09 · 115 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1119 Pre- and Post-order Traversals (30 分)
编程题1119 Pre- and Post-order Traversals (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 inord...原创 2018-11-09 11:07:53 · 127 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1004 Counting Leaves (30 分)
编程题1004 Counting Leaves (30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contain...原创 2018-11-02 10:28:18 · 141 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1020 Tree Traversals (25 分)
编程题1020 Tree Traversals (25 分)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 or...原创 2018-11-02 15:31:45 · 128 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1053 Path of Equal Weight (30 分)
编程题1053 Path of Equal Weight (30 分)Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the weigh...原创 2018-11-04 23:29:31 · 137 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1034 Head of a Gang (30 分)
编程题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 ...原创 2018-11-13 23:41:31 · 134 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1076 Forwards on Weibo (30 分)
编程题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 forme...原创 2018-11-16 00:16:31 · 140 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1021 Deepest Root (25 分)
编程题1021 Deepest Root (25 分)A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the root that results in...原创 2018-11-12 19:16:08 · 134 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1072 Gas Station (30 分)
编程题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 mu...原创 2018-11-14 21:03:16 · 150 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1086 Tree Traversals Again (25 分)
编程题1086 Tree Traversals Again (25 分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbe...原创 2018-11-09 09:53:15 · 96 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1079 Total Sales of Supply Chain (25 分)
编程题1079 Total Sales of Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.St...原创 2018-11-09 09:48:29 · 129 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1002 A+B for Polynomials (25)(25 分)
编程题1002 A+B for Polynomials (25)(25 分)This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line c...原创 2018-06-16 14:41:42 · 182 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1005 Spell It Right (20)(20 分)
编程题1005 Spell It Right (20)(20 分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input fil...原创 2018-06-18 16:53:39 · 157 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1035 Password (20)(20 分)
编程题1035 Password (20)(20 分)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to dis...原创 2018-06-19 11:23:32 · 156 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1008 Elevator (20)(20 分)
编程题1008 Elevator (20)(20 分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in spec...原创 2018-06-19 19:24:39 · 126 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1011 World Cup Betting (20)(20 分)
编程题1011 World Cup Betting (20)(20 分)With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the ...原创 2018-06-19 19:53:17 · 107 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1019 General Palindromic Number (20)(20 分)
编程题1019 General Palindromic Number (20)(20 分)A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All...原创 2018-06-19 20:18:08 · 143 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1023 Have Fun with Numbers (20)(20 分)
编程题1023 Have Fun with Numbers (20)(20 分)Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which ...原创 2018-07-03 20:19:16 · 137 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1027 Colors in Mars (20)(20 分)
编程题1027 Colors in Mars (20)(20 分)People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 dig...原创 2018-07-11 10:47:49 · 119 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1012 The Best Rank (25)(25 分)
编程题1012 The Best Rank (25)(25 分)To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus...原创 2018-07-04 12:42:38 · 105 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1031 Hello World for U (20)(20 分)
编程题1031 Hello World for U (20)(20 分)Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "helloworld" can be printed as:h de ll rlowo...原创 2018-07-11 15:51:16 · 135 阅读 · 1 评论 -
PAT (Advanced Level) Practice 1107 Social Clusters (30 分)
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...原创 2018-11-01 15:18:30 · 148 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1114 Family Property (25 分)
编程题1114 Family Property (25 分)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, w...原创 2018-11-01 20:49:50 · 111 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1118 Birds in Forest (25 分)
编程题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...原创 2018-11-01 21:25:52 · 104 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1013 Battle Over Cities (25 分)
编程题1013 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...原创 2018-11-14 23:33:55 · 155 阅读 · 0 评论