PAT甲级
文章平均质量分 77
PAT甲级题解
疯疯癫癫才自由
这个作者很懒,什么都没留下…
展开
-
PAT甲级2023夏季考试题解(A-1 Trap,A-2 Queue Using Two Stacks,A-3 Rank of Binary Tree,A-4 Big Number)
A-1 Trap分数 20作者 陈越单位 浙江大学。原创 2023-06-14 00:10:17 · 1715 阅读 · 0 评论 -
A-2 LRU-K(攀拓(PAT)- 程序设计(甲级)2023年春季考试仿真卷)
A-2 LRU-K分数 25作者 陈越单位 浙江大学。原创 2023-06-09 17:27:15 · 1642 阅读 · 0 评论 -
PAT A1001 A+B Format
1001 A+B Format分数 20作者 CHEN, Yue单位 浙江大学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).原创 2022-11-11 12:33:08 · 156 阅读 · 0 评论 -
PAT A1002 A+B for Polynomials
1002 A+B for Polynomials分数 25作者 CHEN, Yue单位 浙江大学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 informat原创 2022-11-11 12:27:48 · 348 阅读 · 0 评论 -
PAT A1003 Emergency
PAT (Advanced Level) Practice1003 Emergency分数 25作者 CHEN, Yue单位 浙江大学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 i原创 2022-08-16 15:40:48 · 123 阅读 · 0 评论 -
PAT A1004 Counting Leaves
1004 Counting Leaves分数 30作者 CHEN, Yue单位 浙江大学A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.原创 2022-11-13 18:38:07 · 276 阅读 · 0 评论 -
PAT A1005 Spell It Right
1005 Spell It Right分数 20作者 CHEN, Yue单位 浙江大学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.原创 2022-11-13 18:25:54 · 130 阅读 · 0 评论 -
PAT A1006 Sign In and Sign Out
1006 Sign In and Sign Out分数 25作者 CHEN, Yue单位 浙江大学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, yo原创 2022-11-13 18:23:03 · 233 阅读 · 0 评论 -
PAT A1007 Maximum Subsequence Sum
1007 Maximum Subsequence Sum分数 25作者 CHEN, Yue单位 浙江大学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 subsequence which原创 2022-11-13 18:19:33 · 356 阅读 · 0 评论 -
PAT A1008 Elevator
1008 Elevator分数 20作者 CHEN, Yue单位 浙江大学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 seconds to mov原创 2022-11-13 18:09:59 · 139 阅读 · 0 评论 -
PAT A1009 Product of Polynomials
1009 Product of Polynomials分数 25作者 CHEN, Yue单位 浙江大学This time, you are supposed to find A×B where A and B are two polynomials.//直接用两个数组存储输入,再进行相乘,最后的结果排序相加去重,就可得到答案原创 2022-11-13 18:02:45 · 114 阅读 · 0 评论 -
PAT A1010 Radix(进制转换)
1010 Radix分数 25作者 CHEN, Yue单位 浙江大学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.原创 2022-11-13 17:57:16 · 287 阅读 · 0 评论 -
PAT A1013 Battle Over Cities分数 25(连通块数量,割点是针对连通块的,不是整个图)
1013 Battle Over Cities分数 25作者 CHEN, Yue单位 浙江大学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 need原创 2022-11-20 17:44:48 · 301 阅读 · 0 评论 -
PAT A1014 Waiting in Line
1014 Waiting in Line分数 30作者 CHEN, Yue单位 浙江大学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:原创 2022-12-01 11:10:49 · 439 阅读 · 0 评论 -
PAT A1016 Phone Bills
1016 Phone Bills分数 25作者 CHEN, Yue单位 浙江大学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 custo原创 2022-11-15 21:50:10 · 200 阅读 · 0 评论 -
PAT A1017 Queueing at Bank
1017 Queueing at Bank分数 25作者 CHEN, Yue单位 浙江大学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 line,原创 2022-12-01 11:01:31 · 388 阅读 · 0 评论 -
PAT A1017 Queueing at Bank
1017 Queueing at Bank分数 25作者 CHEN, Yue单位 浙江大学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 line,原创 2022-11-25 21:41:34 · 597 阅读 · 0 评论 -
PAT A1018 Public Bike Management(Dijkstra + DFS)
1018 Public Bike Management分数 30作者 CHEN, Yue单位 浙江大学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 stations in t原创 2022-11-20 00:14:23 · 342 阅读 · 0 评论 -
PAT A1020 Tree Traversals
1020 Tree Traversals分数 25作者 CHEN, Yue单位 浙江大学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 corresp原创 2022-11-16 16:16:12 · 432 阅读 · 0 评论 -
PAT A1034 Head of a Gang
1034 Head of a Gang分数 30作者 CHEN, Yue单位 浙江大学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 the to原创 2022-11-20 12:36:46 · 614 阅读 · 0 评论 -
PAT A1057 Stack
PAT甲级 A10571057 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) and Pop (deleting the top element)原创 2022-06-27 21:45:53 · 140 阅读 · 0 评论 -
PAT A1064 Complete Binary Search Tree 03-树3 Tree Traversals Again(一棵树建立为完全二叉搜索树)
03-树3 Tree Traversals Again分数 25作者 陈越单位 浙江大学push(2);push(3);pop();pop();push(4);pop();pop();push(5);push(6);pop();Figure 1。原创 2022-08-16 15:24:29 · 95 阅读 · 0 评论 -
11-散列2 Hashing(浙大数据结构)
11-散列2 Hashing分数 25作者 陈越单位 浙江大学。原创 2022-09-03 12:46:35 · 273 阅读 · 0 评论