
PAT
文章平均质量分 77
xyzchenzd
非淡泊无以明志,非宁静无以致远
展开
-
PAT A 1052. Linked List Sorting (25)
题目A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and aNext pointer to the next structure. N原创 2014-05-19 13:01:05 · 515 阅读 · 0 评论 -
PAT A 1068. Find More Coins (30)
题目原创 2014-05-24 13:21:03 · 558 阅读 · 0 评论 -
PAT A 1066. Root of AVL Tree (25)
题目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 differ by more than one, rebalanci原创 2014-05-24 12:53:16 · 769 阅读 · 0 评论 -
PAT A 1062. Talent and Virtue (25)
题目About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and原创 2014-05-23 10:49:47 · 535 阅读 · 0 评论 -
PAT A 1065. A+B and C (64bit) (20)
题目Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.Input Specification: The first line of the input gives the positive number of test cases, T (Output S原创 2014-05-24 12:40:04 · 893 阅读 · 0 评论 -
PAT A 1063. Set Similarity (25)
题目Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt is the total number of distin原创 2014-05-23 10:58:17 · 426 阅读 · 0 评论 -
PAT A 1069. The Black Hole of Numbers (20)
题目For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by t原创 2014-05-25 12:26:48 · 475 阅读 · 0 评论 -
PAT A 1070. Mooncake (25)
题目Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture.原创 2014-05-25 12:37:01 · 471 阅读 · 0 评论 -
PAT A 1071. Speech Patterns (25)
题目原创 2014-05-25 12:48:36 · 509 阅读 · 0 评论 -
PAT A 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 guarantee that all th原创 2014-05-25 12:57:34 · 585 阅读 · 0 评论 -
PAT A 1073. Scientific Notation (20)
题目Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9]"."[0-9]+E[+-][0-9]+ which means that t原创 2014-05-26 13:10:23 · 585 阅读 · 0 评论 -
PAT A 1061. Dating (20)
题目Sherlock Holmes received a note with some strange strings: "Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm". It took him only a minute to figure out that those strange stri原创 2014-05-23 10:32:31 · 515 阅读 · 0 评论 -
PAT A 1067. Sort with Swap(0,*) (25)
题目Given any permutation of the numbers {0, 1, 2,..., N-1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4原创 2014-05-24 13:09:45 · 654 阅读 · 0 评论 -
PAT A 1032. Sharing (25)
题目To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For ex原创 2014-05-12 14:20:56 · 489 阅读 · 0 评论 -
PAT A 1054. The Dominant Color (20)
题目Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called原创 2014-05-20 16:00:12 · 483 阅读 · 0 评论 -
PAT A 1055. The World's Richest (25)
题目Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the原创 2014-05-20 16:15:18 · 469 阅读 · 0 评论 -
PAT A 1056. Mice and Rice (25)
题目Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much原创 2014-05-20 16:36:46 · 677 阅读 · 0 评论 -
PAT A 1053. Path of Equal Weight (30)
题目Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. Theweight of a path from R to L is defined to be the sum of the weights of all the nodes along the path fro原创 2014-05-20 15:54:54 · 572 阅读 · 0 评论 -
PAT A 1058. A+B in Hogwarts (20)
题目If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to原创 2014-05-22 12:19:24 · 490 阅读 · 0 评论 -
PAT A 1057. Stack (30)
题目Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) a原创 2014-05-22 12:13:51 · 531 阅读 · 0 评论 -
PAT A 1060. Are They Equal (25)
题目原创 2014-05-22 12:41:47 · 624 阅读 · 0 评论 -
PAT A 1059. Prime Factors (25)
题目原创 2014-05-22 12:27:51 · 471 阅读 · 0 评论 -
PAT A 1064. Complete Binary Search Tree (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 keys less than the node's key. The r原创 2014-05-23 12:18:04 · 539 阅读 · 0 评论 -
PAT A 1076. Forwards on Weibo (30)
题目原创 2014-05-26 13:49:44 · 679 阅读 · 0 评论 -
PAT A 1074. Reversing Linked List (25)
题目iven a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K = 3, then you must output 3→2→1→6→5→4; i原创 2014-05-26 13:18:14 · 610 阅读 · 0 评论 -
PAT A 1075. PAT Judge (25)
题目The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist for PAT.Input Specification: Each input原创 2014-05-26 13:37:43 · 2830 阅读 · 0 评论 -
PAT A 1089. Insert or Merge (25)
题目According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input d原创 2014-12-03 10:49:40 · 943 阅读 · 0 评论 -
PAT A 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.Starting from one root supplier, everyone o原创 2014-12-04 10:11:37 · 618 阅读 · 0 评论 -
PAT A 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 MRI slice, your job is原创 2014-12-08 10:38:30 · 1104 阅读 · 0 评论 -
PAT A 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 generation with the largest population.In原创 2015-03-19 18:20:38 · 867 阅读 · 0 评论 -
PAT A 1092. To Buy or Not to Buy (20)
题目Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only原创 2015-03-17 14:48:24 · 950 阅读 · 0 评论 -
PAT A 1093. Count PAT's (25)
题目The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.原创 2015-03-17 15:12:24 · 564 阅读 · 0 评论 -
PAT A 1095. Cars on Campus (30)
题目Zhejiang University has 6 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 information available, y原创 2015-03-22 14:38:07 · 583 阅读 · 0 评论 -
PAT A 1097. Deduplication on a Linked List (25)
题目Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the value原创 2015-04-02 10:39:10 · 1008 阅读 · 0 评论 -
PAT A 1096. Consecutive Factors (20)
题目Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7, where 5, 6, and 7 are the three consecutive numbers. Now gi原创 2015-04-01 13:47:52 · 1526 阅读 · 0 评论 -
PAT A 1098. Insertion or Heap Sort (25)
题目According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input d原创 2015-04-07 11:03:18 · 2540 阅读 · 0 评论 -
PAT A 1088. Rational Arithmetic (20)
题目For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification: Each input file contains one t原创 2014-12-02 10:45:39 · 873 阅读 · 0 评论 -
PAT A 1085. Perfect Sequence (25)
题目原创 2014-09-25 20:03:27 · 480 阅读 · 0 评论 -
PAT A 1077. Kuchiguse (20)
题目The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such a preference is cal原创 2014-05-27 14:56:56 · 787 阅读 · 0 评论 -
PAT A 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.Starting from one root supplier, everyone o原创 2014-05-27 15:11:42 · 843 阅读 · 0 评论