pat
vientof
这个作者很懒,什么都没留下…
展开
-
PAT甲级 1003 - Emergency
PAT甲级 1003题目 Emergency解析源码代码题目 EmergencyAs 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. Am...原创 2020-02-01 22:52:58 · 114 阅读 · 0 评论 -
PAT甲级 1004 - dfs 和 bfs
PAT甲级 1004题目 Counting Leaves解析源码代码代码 - bfs代码 - dfs题目 Counting LeavesA family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Sp...原创 2020-02-01 22:48:16 · 263 阅读 · 0 评论 -
PAT甲级 1020
PAT甲级 1020题目 Tree Traversals解析代码题目 Tree TraversalsSuppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to...原创 2019-11-23 15:50:18 · 173 阅读 · 0 评论 -
PAT甲级 1095
PAT甲级 1095题目 Cars on Campus解析代码题目 Cars on CampusZhejiang University has 8 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 ...原创 2019-09-23 15:35:38 · 231 阅读 · 0 评论 -
PAT甲级 1078
PAT甲级 1078题目 Hashing解析代码题目 HashingThe 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 func...原创 2019-08-29 15:24:48 · 222 阅读 · 0 评论 -
PAT甲级 1067
PAT甲级 1067题目 Sort with Swap(0, i)解析代码题目 Sort with Swap(0, i)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 op...原创 2019-08-27 14:40:50 · 172 阅读 · 0 评论 -
PAT甲级 1063
PAT甲级 1063题目 Set Similarity解析代码题目 Set SimilarityGiven 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 s...原创 2019-08-26 15:27:42 · 154 阅读 · 0 评论 -
PAT甲级 1061
PAT甲级 1061题目 Dating解析代码题目 DatingSherlock Holmes received a note with some strange strings: Let’s date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to fi...原创 2019-08-26 13:49:28 · 158 阅读 · 0 评论 -
PAT甲级 1041
PAT甲级 1041题目 Be Unique解析代码题目 Be UniqueBeing 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 ...原创 2019-08-23 14:13:02 · 92 阅读 · 0 评论 -
PAT甲级 1040
PAT甲级 1040题目 Longest Symmetric String解析代码题目 Longest Symmetric StringGiven a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symm...原创 2019-08-23 13:49:30 · 168 阅读 · 0 评论 -
PAT甲级 1042
PAT甲级 1042题目 Shuffling Machine解析代码题目 Shuffling MachineShuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avo...原创 2019-08-23 14:49:51 · 178 阅读 · 0 评论 -
PAT甲级 1039
PAT甲级 1039题目 Course List for Student解析代码题目 Course List for StudentZhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supp...原创 2019-08-22 18:00:27 · 182 阅读 · 1 评论 -
PAT甲级 1037
PAT甲级 1037题目 Magic Coupon解析代码题目 Magic CouponThe 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, ...原创 2019-08-22 16:57:18 · 181 阅读 · 0 评论 -
PAT甲级 1036
PAT甲级 1036题目 Boys vs Girls解析代码题目 Boys vs GirlsThis 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.Inpu...原创 2019-08-22 16:36:06 · 98 阅读 · 0 评论 -
PAT甲级 1083
PAT甲级 1082题目 List Grades解析代码题目 List GradesGiven 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 ou...原创 2019-08-30 14:01:41 · 198 阅读 · 0 评论 -
PAT甲级 1084
PAT甲级 1083题目 Broken Keyboard解析代码题目 Broken KeyboardOn 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...原创 2019-08-30 14:26:36 · 149 阅读 · 0 评论 -
PAT甲级 1128
PAT甲级 1128题目 N Queens Puzzle解析代码题目 N Queens PuzzleThe “eight queens puzzle” is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solu...原创 2019-10-09 19:32:16 · 183 阅读 · 0 评论 -
PAT甲级 1125
PAT甲级 1125题目 Chain the Ropes解析代码题目 Chain the RopesGiven some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into ...原创 2019-10-08 16:58:07 · 182 阅读 · 0 评论 -
PAT甲级 1116
PAT甲级 1116题目 Come on! Let's C解析代码题目 Come on! Let’s C“Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea ...原创 2019-10-02 21:40:16 · 240 阅读 · 0 评论 -
PAT甲级 1113
PAT甲级 1113题目 Integer Set Partition解析代码题目 Integer Set PartitionGiven a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n...原创 2019-10-02 16:47:43 · 193 阅读 · 0 评论 -
PAT甲级 1106
PAT甲级 1106PAT甲级 1106解析代码PAT甲级 1106A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting fr...原创 2019-09-28 15:47:04 · 272 阅读 · 0 评论 -
PAT甲级 1102
PAT甲级 1102题目解析代码题目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 whiteboard so fuck off.Now ...原创 2019-09-25 18:03:10 · 194 阅读 · 0 评论 -
PAT甲级 1100
PAT甲级 1100题目 Mars Numbers解析代码题目 Mars NumbersPeople on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may,...原创 2019-09-24 17:13:11 · 292 阅读 · 0 评论 -
PAT甲级 1097
PAT甲级 1097题目解析代码题目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...原创 2019-09-23 17:13:48 · 210 阅读 · 0 评论 -
PAT甲级 1096
PAT甲级 1096题目 Consecutive Factors解析代码题目 Consecutive FactorsAmong 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, wh...原创 2019-09-23 15:38:30 · 197 阅读 · 0 评论 -
PAT甲级 1088
PAT甲级 1088题目 Rational Arithmetic解析代码题目 Rational ArithmeticFor two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotien...原创 2019-08-31 14:33:21 · 207 阅读 · 0 评论 -
PAT甲级 1035
PAT甲级 1035题目 Password解析代码题目 PasswordTo 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...原创 2019-08-22 16:15:20 · 148 阅读 · 0 评论 -
PAT甲级 1031
PAT甲级 1031题目 Hello World for U解析代码题目 Hello World for UGiven 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 ...原创 2019-08-21 18:01:02 · 117 阅读 · 0 评论 -
PAT甲级 1069
PAT甲级 1069题目 The Black Hole of Numbers解析代码题目 The Black Hole of NumbersFor any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first...原创 2019-08-16 15:33:38 · 246 阅读 · 0 评论 -
PAT甲级 1046
PAT甲级 1046题目 Shortest Distance解析代码题目 Shortest DistanceThe task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any ...原创 2019-08-24 14:25:14 · 231 阅读 · 0 评论 -
PAT甲级 1012
PAT甲级 1012题目 The Best Rank解析代码题目 The Best RankTo evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Math...原创 2019-08-11 15:24:17 · 138 阅读 · 0 评论 -
PAT甲级 1011
PAT甲级 1011题目 World Cup Betting解析题目 World Cup BettingWith the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doi...原创 2019-08-10 19:51:15 · 218 阅读 · 0 评论 -
PAT甲级 1009 - Product of Polynomials
PAT甲级 1009题目 Product of Polynomials解析代码题目 Product of PolynomialsThis time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test c...原创 2019-08-10 15:55:47 · 230 阅读 · 0 评论 -
PAT甲级 1008
PAT甲级 1008题目 Elevator解析代码题目 ElevatorThe 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 s...原创 2019-08-09 18:02:17 · 170 阅读 · 0 评论 -
PAT甲级 1007
PAT甲级 1007题目 Maximum Subsequence Sum解析代码题目 Maximum Subsequence SumGiven a sequence of K integers { N1, N2 , …, NK}. A continuous subsequence is defined to be { Ni , Ni+1, …, Nj} where 1≤i≤...原创 2019-08-09 17:51:00 · 177 阅读 · 0 评论 -
PAT甲级 1006
PAT甲级 1006题目 Sign In and Sign Out解析代码题目 Sign In and Sign OutAt 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 ...原创 2019-08-09 17:02:12 · 155 阅读 · 0 评论 -
PAT甲级 1005
PAT甲级 1005题目 Spell It Right解析代码题目 Spell It RightGiven 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 Specifica...原创 2019-08-09 16:30:54 · 292 阅读 · 0 评论 -
PAT甲级 1019
PAT甲级 1019题目 General Palindromic Number解析代码题目 General Palindromic NumberA number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 123432...原创 2019-08-13 18:06:50 · 157 阅读 · 0 评论 -
PAT甲级 1002
PAT甲级 1002题目 A+B for Polynomials解析代码题目 A+B for PolynomialsThis time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Eac...原创 2019-08-06 20:15:12 · 228 阅读 · 0 评论 -
PAT甲级 1001
PAT甲级 1001题目 A+B Format解析代码题目 A+B FormatCalculate 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 d...原创 2019-08-06 18:37:20 · 103 阅读 · 0 评论