
PAT
ysq96
还想更厉害
展开
-
A1001. A+B Format (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).InputEach input file contains one...原创 2018-03-19 16:01:24 · 176 阅读 · 0 评论 -
1002. A+B for Polynomials (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 contains the information of a polynomia...原创 2018-03-20 13:46:30 · 121 阅读 · 0 评论 -
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.InputEach input file contains one test case. Each case starts with a line contai...原创 2018-03-23 20:42:43 · 140 阅读 · 0 评论 -
1005. Spell It Right (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 file contains one test case. Each ca...原创 2018-03-23 21:07:32 · 231 阅读 · 0 评论 -
1003. Emergency (25)
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 l...原创 2018-03-20 14:59:44 · 115 阅读 · 0 评论 -
1009. Product of Polynomials (25)
This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information...原创 2018-04-07 18:03:17 · 162 阅读 · 0 评论 -
1006. Sign In and Sign Out (25)
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you...原创 2018-03-25 19:31:34 · 162 阅读 · 0 评论 -
1007. Maximum Subsequence Sum (25)
Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj} where 1 <= i <= j <= K. The Maximum Subsequence is the continuous subsequenc...原创 2018-04-05 20:29:31 · 129 阅读 · 0 评论 -
1008. Elevator (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 specified order. It costs 6 sec...原创 2018-04-05 20:49:01 · 139 阅读 · 0 评论 -
1010. Radix (25)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number.Now for any pair of positive inte...原创 2018-05-19 16:56:14 · 144 阅读 · 0 评论 -
1011.World Cup Betting (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 World Cup trophy in South Africa. Si...原创 2018-05-19 17:36:48 · 110 阅读 · 0 评论 -
1012 The Best Rank (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 or Linear Algebra), and E - Eng...原创 2018-05-20 17:07:55 · 329 阅读 · 0 评论 -
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. We must know immediately if we nee...原创 2018-05-20 18:05:06 · 161 阅读 · 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 is made. When a...原创 2018-05-26 17:27:33 · 1137 阅读 · 0 评论 -
1017 Queueing at Bank (25)
Suppose 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 customers have to wait in line behind the yellow li...原创 2018-05-26 22:32:53 · 241 阅读 · 0 评论 -
1014 Waiting in Line (30)
Suppose 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 for the customers to wait in line are:The space i...原创 2018-05-23 11:28:33 · 158 阅读 · 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 is also a pr...原创 2018-05-24 17:23:41 · 2095 阅读 · 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...原创 2018-06-22 12:06:40 · 153 阅读 · 0 评论 -
1019 General Palindromic Number (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 single digit numbers are palindromic numbers...原创 2018-07-01 20:03:06 · 199 阅读 · 0 评论 -
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 order traversal sequence of the cor...原创 2018-07-01 20:46:46 · 1619 阅读 · 1 评论 -
1033 To Fill or Not to Fill (25)
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 stations on the way from time to time. Different ga...原创 2018-07-08 21:46:15 · 117 阅读 · 0 评论 -
1021 Deepest Root (25)
A 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 root that results in a highest tree. Such a root ...原创 2018-07-02 20:45:22 · 122 阅读 · 0 评论 -
1022 Digital Library (30)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...原创 2018-07-02 21:18:02 · 148 阅读 · 0 评论 -
1035 Password (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 distinguish 1 (one) from l (L ...原创 2018-07-09 18:38:07 · 209 阅读 · 0 评论 -
1036 Boys vs Girls (25)
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 Specification:Each input file contains one test ...原创 2018-07-09 19:06:04 · 1662 阅读 · 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 product b...原创 2018-07-09 19:29:21 · 173 阅读 · 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-3214-0229-8...原创 2018-07-09 19:48:33 · 195 阅读 · 0 评论 -
1051 Pop Sequence (25)
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of t...原创 2018-07-16 20:09:37 · 112 阅读 · 0 评论 -
1023 Have Fun with Numbers (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 happens to be another 9-digit number con...原创 2018-07-03 21:10:16 · 173 阅读 · 0 评论 -
1024 Palindromic Number (25)
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 single digit numbers are palindromic numbers...原创 2018-07-03 22:07:09 · 258 阅读 · 0 评论 -
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 a Next pointer to the next structure. Now g...原创 2018-07-16 20:37:19 · 118 阅读 · 0 评论 -
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 example,...原创 2018-07-10 19:54:50 · 320 阅读 · 0 评论 -
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 of a relation is defined to be t...原创 2018-07-10 19:56:01 · 203 阅读 · 0 评论 -
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 who comes ...原创 2018-07-10 20:42:43 · 136 阅读 · 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 ...原创 2018-07-10 21:10:21 · 224 阅读 · 0 评论 -
1041 Be Unique (20)
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, 10^4^]. The first one who bets o...原创 2018-07-10 21:32:51 · 249 阅读 · 0 评论 -
1025 PAT Ranking (25)
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 several places, and the ranklists w...原创 2018-07-04 21:41:01 · 289 阅读 · 0 评论 -
1026 Table Tennis (30)
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 arrive, they will be assigned to the ava...原创 2018-07-04 21:48:50 · 1070 阅读 · 1 评论 -
1053 Path of Equal Weight (30)
Given a non-empty tree with root R, and with weight W~i~ assigned to each tree node T~i~. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from ...原创 2018-07-17 20:17:24 · 593 阅读 · 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 called the d...原创 2018-07-17 20:29:40 · 142 阅读 · 0 评论