pintia
Cute_jinx
这个作者很懒,什么都没留下…
展开
-
(PAT)1155 Heap Paths (30分)(cj)
声明: 博客内所有英文题目来自https://pintia.cn/ 中 PAT(Advanced Level) Practice, 博客内容只用于学术目的,仅为PAT入门提供一个参考,不用于任何商业行为。 转载请注明出处。 1155Heap Paths(30分)In computer science, aheapis a specialized tree...原创 2020-05-19 12:22:55 · 188 阅读 · 0 评论 -
(PAT)1154 Vertex Coloring (25分)(cj)
声明: 博客内所有英文题目来自https://pintia.cn/ 中 PAT(Advanced Level) Practice, 博客内容只用于学术目的,仅为PAT入门提供一个参考,不用于任何商业行为。 转载请注明出处。 1154Vertex Coloring(25分)Aproper vertex coloringis a labeling of the g...原创 2020-05-19 12:18:50 · 201 阅读 · 0 评论 -
(PAT)1153 Decode Registration Card of PAT (25分) (cj)
声明: 博客内所有英文题目来自 https://pintia.cn/ 中 PAT(Advanced Level) Practice, 博客内容只用于学术目的,仅为PAT入门提供一个参考,不用于任何商业行为。 1153Decode Registration Card of PAT(25分)A registration card number of PAT consists of 4 parts:the 1s...原创 2020-05-19 12:13:31 · 240 阅读 · 0 评论 -
(PAT)1152 Google Recruitment (20分) (cj)
声明: 博客内所有英文题目来自 https://pintia.cn/ 中 PAT(Advanced Level) Practice, 博客内容只用于学术目的,仅为PAT入门提供一个参考,不用于任何商业行为。 1152Google Recruitment(20分)In July 2004, Google posted on a giant billboard alon...原创 2020-05-19 12:06:30 · 351 阅读 · 0 评论 -
1016 Phone Bills (25)(25 points) (cj)
1016 Phone Bills (25)(25 point(s))QuestionsA long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending o...原创 2018-07-28 15:00:59 · 179 阅读 · 0 评论 -
1020 Tree Traversals (25)(25 point(s) (cj)
1020 Tree Traversals (25)(25 point(s))QuestionsSuppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to out...原创 2018-07-29 15:42:19 · 180 阅读 · 0 评论 -
1019 General Palindromic Number (20)(20 point(s))
1019 General Palindromic Number (20)(20 point(s))QuestionsA number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindro...原创 2018-07-29 15:44:34 · 137 阅读 · 0 评论 -
1017 Queueing at Bank (25)(25 point(s))(cj)
1017 Queueing at Bank (25)(25 point(s))QuestionsSuppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c...原创 2018-07-29 15:46:41 · 114 阅读 · 0 评论 -
1014 Waiting in Line (30)(30 point(s) (cj)
1014 Waiting in Line (30)(30 point(s))QuestionsSuppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules ...原创 2018-07-29 15:49:20 · 165 阅读 · 0 评论 -
1004 Counting Leaves (30)(30 point(s)
1004 Counting Leaves (30)(30 point(s))QuestionsA family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.InputEach input file contai...原创 2018-07-29 15:51:03 · 253 阅读 · 0 评论 -
1002 A+B for Polynomials (25)(25 point(s) (cj)
1002 A+B for Polynomials (25)(25 point(s))QuestionsThis 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 lin...原创 2018-07-29 15:53:28 · 523 阅读 · 0 评论 -
1007 Maximum Subsequence Sum (25)(25 point(s))(cj)
1007 Maximum Subsequence Sum (25)(25 point(s))QuestionsGiven a sequence of K integers { N~1~, N~2~, ..., N~K~ }. A continuous subsequence is defined to be { N~i~, N~i+1~, ..., N~j~ } where 1 <= i...原创 2018-07-29 15:54:33 · 570 阅读 · 0 评论 -
1021 Deepest Root (25)(25 point(s))(cj)
1021 Deepest Root (25)(25 point(s))QuestionsA 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 roo...原创 2018-07-29 17:29:39 · 175 阅读 · 0 评论 -
01078 字符串压缩与解压(20 point(s))
1078 字符串压缩与解压(20 point(s))文本压缩有很多种方法,这里我们只考虑最简单的一种:把由相同字符组成的一个连续的片段用这个字符和片段中含有这个字符的个数来表示。例如 ccccc 就用 5c 来表示。如果字符没有重复,就原样输出。例如 aba 压缩后仍然是 aba。解压方法就是反过来,把形如 5c 这样的表示恢复为 ccccc。本题需要你根据压缩或解压的要求,对给定字符...原创 2018-07-29 17:31:53 · 172 阅读 · 0 评论 -
1018 Public Bike Management (30)(30 point(s))(cj)
1018 Public Bike Management (30)(30 point(s))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 stat...原创 2018-07-31 11:57:24 · 198 阅读 · 0 评论 -
1022 Digital Library (30)(30 point(s))(cj)
1022 Digital Library (30)(30 point(s))A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each boo...原创 2018-07-31 11:58:15 · 109 阅读 · 0 评论 -
1023 Have Fun with Numbers (20)(20 point(s)(cj)
1023 Have Fun with Numbers (20)(20 point(s))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, ...原创 2018-07-31 12:33:10 · 154 阅读 · 0 评论 -
1032 Sharing (25)(25 point(s)(cj)
1032 Sharing (25)(25 point(s))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 sha...原创 2018-08-09 13:25:11 · 139 阅读 · 0 评论 -
1025 PAT Ranking (25)(25 point(s)(cj)
1025 PAT Ranking (25)(25 point(s))Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in...原创 2018-07-31 16:58:07 · 159 阅读 · 0 评论 -
1034 Head of a Gang (30)(30 point(s)(cj)
1034 Head of a Gang (30)(30 point(s))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 ...原创 2018-08-09 22:09:37 · 163 阅读 · 0 评论 -
1035 Password (20)(20 point(s)(cj)
1035 Password (20)(20 point(s))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 ...原创 2018-08-09 22:51:46 · 149 阅读 · 0 评论 -
1036 Boys vs Girls (25)(25 point(s)(cj)
1036 Boys vs Girls (25)(25 point(s))This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specific...原创 2018-08-10 10:00:15 · 423 阅读 · 0 评论 -
1037 Magic Coupon (25)(25 point(s)(cj)
1037 Magic Coupon (25)(25 point(s))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 ge...原创 2018-08-10 10:37:25 · 149 阅读 · 0 评论 -
1039 Course List for Student (25)(25 point(s)(cj)
1039 Course List for Student (25)(25 point(s))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 re...原创 2018-08-10 11:59:40 · 276 阅读 · 0 评论 -
1030 Travel Plan (30)(30 point(s))
1030 Travel Plan (30)(30 point(s))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 tr...原创 2018-08-06 14:51:28 · 157 阅读 · 0 评论 -
1026 Table Tennis (30)(30 point(s))
1026 Table Tennis (30)(30 point(s))A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arr...原创 2018-08-06 16:32:07 · 296 阅读 · 0 评论 -
1027 Colors in Mars (20)(20 point(s)(cj)
1027 Colors in Mars (20)(20 point(s))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...原创 2018-08-03 11:30:34 · 121 阅读 · 0 评论 -
1028 List Sorting (25)(25 point(s)(cj)
1028 List Sorting (25)(25 point(s))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 f...原创 2018-08-03 11:46:16 · 116 阅读 · 0 评论 -
1029 Median(25 point(s)(cj)
1029 Median(25 point(s))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 ...原创 2018-08-03 13:31:21 · 328 阅读 · 0 评论 -
1031 Hello World for U (20)(20 point(s))(cj)
1031 Hello World for U (20)(20 point(s))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 l...原创 2018-08-08 10:29:24 · 128 阅读 · 0 评论 -
1033 To Fill or Not to Fill (25)(25 point(s)(cj)
1033 To Fill or Not to Fill (25)(25 point(s))With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stat...原创 2018-08-08 19:32:17 · 247 阅读 · 0 评论 -
1040 Longest Symmetric String (25)(25 point(s))
1040 Longest Symmetric String (25)(25 point(s))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 ...原创 2018-08-18 17:40:44 · 215 阅读 · 0 评论 -
1042 Shuffling Machine (20)(20 point(s))
1042 Shuffling Machine (20)(20 point(s))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...原创 2018-08-16 08:10:55 · 182 阅读 · 0 评论 -
1041 Be Unique (20)(20 point(s))
1041 Be Unique (20)(20 point(s))Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1...原创 2018-08-16 08:11:49 · 139 阅读 · 0 评论 -
1038 Recover the Smallest Number (30)(30 point(s))
1038 Recover the Smallest Number (30)(30 point(s))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 c...原创 2018-08-19 16:40:30 · 191 阅读 · 0 评论 -
1057 Stack(30 分) (cj)
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 to...原创 2018-08-26 15:16:57 · 288 阅读 · 0 评论 -
1060 Are They Equal(25 分)(cj)
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...原创 2018-08-26 17:38:41 · 192 阅读 · 0 评论 -
1048 Find Coins (25)(25 point(s)(cj)
1048 Find Coins (25)(25 point(s))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 k...原创 2018-08-22 14:20:49 · 127 阅读 · 0 评论 -
1043 Is It a Binary Search Tree (25)(25 point(s))
1043 Is It a Binary Search Tree (25)(25 point(s))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 node...原创 2018-08-19 18:49:50 · 273 阅读 · 0 评论 -
1061 Dating(20 分)
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 th...原创 2018-08-26 18:05:08 · 379 阅读 · 0 评论