PAT
文章平均质量分 79
Yost
这个作者很懒,什么都没留下…
展开
-
1039. Course List for Student (25)
题目:Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student w原创 2015-01-30 22:25:35 · 374 阅读 · 0 评论 -
1037. Magic Coupon (25)
题目:The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that原创 2015-01-30 22:23:28 · 336 阅读 · 0 评论 -
1050. String Subtraction (20)
题目:Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1 - S2 for any given strings.原创 2015-02-02 20:42:20 · 408 阅读 · 0 评论 -
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 cal原创 2015-02-02 21:14:51 · 387 阅读 · 0 评论 -
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原创 2015-02-02 21:25:43 · 344 阅读 · 0 评论 -
1043. Is It a Binary Search Tree (25)
题目: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.原创 2015-01-30 22:29:03 · 511 阅读 · 0 评论 -
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原创 2015-02-03 20:32:15 · 504 阅读 · 0 评论 -
1071. Speech Patterns (25)
题目:People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down原创 2015-03-02 18:52:45 · 453 阅读 · 0 评论 -
1080. Graduate Admission (30)
题目:It is said that in 2013, there were 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原创 2015-03-02 19:15:16 · 504 阅读 · 0 评论 -
1084. Broken Keyboard (20)
题目:On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are原创 2015-03-02 19:21:06 · 581 阅读 · 0 评论 -
1015. Reversible Primes (20)
题目:A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 i原创 2015-01-30 21:55:44 · 433 阅读 · 0 评论 -
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.原创 2015-02-02 23:17:44 · 435 阅读 · 0 评论 -
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原创 2015-02-02 22:48:07 · 453 阅读 · 0 评论 -
1040. Longest Symmetric String (25)
题目:Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given "Is PAT&TAP symmetric?", the longest symmetric sub-string is "s PAT&TAP s", hence原创 2015-01-30 22:26:54 · 375 阅读 · 0 评论 -
1028. List Sorting (25)
题目:Excel can sort records according to any column. Now you are supposed to imitate this function.InputEach input file contains one test case. For each case, the first line contains two i原创 2015-01-30 22:12:30 · 362 阅读 · 0 评论 -
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原创 2015-02-02 21:46:58 · 1852 阅读 · 0 评论 -
1060. Are They Equal (25)
题目:If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*105 with simple chopping. Now given the number of原创 2015-02-02 22:38:03 · 424 阅读 · 0 评论 -
1016. Phone Bills (25)
题目:A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call原创 2015-01-30 21:56:48 · 387 阅读 · 0 评论 -
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 return it to any other station原创 2015-01-30 22:00:24 · 471 阅读 · 0 评论 -
1038. Recover the Smallest Number (30)
题目:Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given {32, 321, 3214, 0229, 87}, we can recover many numbers such like 32-321-32原创 2015-01-30 22:24:43 · 470 阅读 · 0 评论 -
1042. Shuffling Machine (20)
题目:Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate wit原创 2015-01-30 22:28:16 · 311 阅读 · 0 评论 -
1049. Counting Ones (30)
题目:The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example, given N being 12, there are f原创 2015-02-02 20:41:19 · 404 阅读 · 0 评论 -
1085. Perfect Sequence (25)
题目:Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M Now given a sequence and a parameter p, you are supposed to find原创 2015-03-02 19:22:23 · 992 阅读 · 0 评论 -
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 contai原创 2015-03-02 19:27:33 · 611 阅读 · 0 评论 -
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原创 2015-03-02 19:28:49 · 1106 阅读 · 1 评论 -
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 numbered from 1 to 6) is traver原创 2015-03-02 19:22:54 · 503 阅读 · 0 评论 -
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 th原创 2015-03-02 18:55:45 · 795 阅读 · 0 评论 -
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 i原创 2015-03-02 19:06:23 · 595 阅读 · 0 评论 -
1082. Read Number in Chinese (25)
题目:Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output "Fu" first if it is negative. For example, -123456789 is read as "Fu yi Yi er Q原创 2015-03-02 19:17:54 · 442 阅读 · 0 评论 -
1083. List Grades (25)
题目:Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which th原创 2015-03-02 19:19:37 · 521 阅读 · 0 评论 -
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, eve原创 2015-03-02 19:14:34 · 660 阅读 · 0 评论 -
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原创 2015-03-16 11:22:38 · 534 阅读 · 0 评论 -
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原创 2015-03-16 11:26:20 · 982 阅读 · 0 评论 -
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 availab原创 2015-03-16 11:27:03 · 2288 阅读 · 1 评论 -
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, eve原创 2015-03-02 19:29:22 · 632 阅读 · 0 评论 -
1078. Hashing (25)
题目:The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be "H(key原创 2015-03-02 19:13:15 · 361 阅读 · 0 评论 -
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 happiness.Input Specificat原创 2015-03-02 19:26:03 · 856 阅读 · 0 评论 -
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 jo原创 2015-03-02 19:30:43 · 666 阅读 · 0 评论 -
1068. Find More Coins (30)
题目:Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments.原创 2015-03-02 18:48:59 · 554 阅读 · 0 评论 -
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原创 2015-03-02 18:49:54 · 415 阅读 · 0 评论