![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
PAT刷题经验和总结
自由の翼Az
这个作者很懒,什么都没留下…
展开
-
PAT甲级终结——心得总结
首先报喜一波第一次考,满分,4道题总共花了2个小时做完,一部分是题简单的原因,一部分也是自己三刷了PAT的心血吧。刷PAT的经验神指导: 胡凡-《算法笔记》神助攻:柳婼的博客,百度即可。战场:PAT官网和牛客PAT专项首先,按照算法笔记这本书从一页认真看到最后一页,里面讲的各种算法和数据结构都特别全,特别详细,你按照这本书的章节去练习PAT题,按章节一刷,同时总结每个章节的思路和方法。...原创 2019-12-08 12:25:35 · 218 阅读 · 0 评论 -
PAT甲级——A1024 Palindromic Numberr
题目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 numb...原创 2019-12-05 21:47:22 · 110 阅读 · 0 评论 -
PAT甲级——A1023 Have Fun with Numbers
题目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 ...原创 2019-12-05 21:46:42 · 69 阅读 · 0 评论 -
PAT甲级——A1022 Digital Library
题目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 numbe...原创 2019-12-05 21:38:36 · 78 阅读 · 0 评论 -
PAT甲级——A1021 Deepest Root
题目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 ro...原创 2019-12-05 21:30:09 · 72 阅读 · 0 评论 -
PAT甲级——A1020 Tree Traversals
题目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 ...原创 2019-12-05 21:24:32 · 60 阅读 · 0 评论 -
PAT甲级——A1019 General Palindromic Numberr
题目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 numb...原创 2019-12-05 21:19:16 · 65 阅读 · 0 评论 -
PAT甲级——A1018 Public Bike Management
题目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...原创 2019-12-05 21:13:48 · 77 阅读 · 0 评论 -
PAT甲级——A1017 Queueing at Bank
题目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...原创 2019-12-05 20:44:31 · 64 阅读 · 0 评论 -
PAT甲级——A1016 Phone Bills
题目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. Wh...原创 2019-12-05 20:36:45 · 101 阅读 · 0 评论 -
PAT甲级——A1015 Reversible Prime
题目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...原创 2019-12-05 20:30:20 · 89 阅读 · 0 评论 -
PAT甲级——A1014 Waiting in Linee
题目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 s...原创 2019-12-05 20:16:28 · 91 阅读 · 0 评论 -
PAT甲级——A1013 Battle Over Cities
题目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 ...原创 2019-12-05 20:10:26 · 92 阅读 · 0 评论 -
PAT甲级——A1012 The Best Rank
题目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 Algrbra), and E - ...原创 2019-12-05 19:51:20 · 86 阅读 · 0 评论 -
PAT甲级——A1011 World Cup Betting
题目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....原创 2019-12-05 19:42:47 · 128 阅读 · 0 评论 -
PAT甲级——A1010 Radix
题目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 in...原创 2019-12-05 19:37:54 · 81 阅读 · 0 评论 -
PAT甲级——A1009 Product of Polynomials
题目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 inform...原创 2019-12-05 16:41:02 · 76 阅读 · 0 评论 -
PAT甲级——A1008 Elevator
题目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 ...原创 2019-12-05 16:32:47 · 124 阅读 · 0 评论 -
PAT甲级——A1007 Maximum Subesequence Sum
题目Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1. The Maximum Subsequence is the continuous subsequence whic...原创 2019-12-05 16:29:02 · 78 阅读 · 0 评论 -
PAT甲级——A1006 Sign In and Sign Out
题目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, ...原创 2019-12-05 16:20:47 · 124 阅读 · 0 评论 -
PAT甲级——A1005 Spell It Right
题目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. Ea...原创 2019-12-05 16:14:47 · 63 阅读 · 0 评论 -
PAT甲级——A1004 Countion Leaves
题目A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case start...原创 2019-12-05 15:55:00 · 193 阅读 · 0 评论 -
PAT甲级——A1003 Emergency
题目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 th...原创 2019-12-05 15:43:41 · 76 阅读 · 0 评论 -
PAT甲级——A1002 A+B for Polynomials
题目Each input file contains one test case.Input Specification:Each case occupies 2 lines, and each line contains the information of a polynomial:K N1 aN1 N2 aN2 … NK aNK...原创 2019-12-05 15:35:18 · 105 阅读 · 0 评论 -
PAT甲级——A1001 A+BFormat
题目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).Input Specification:Each input ...原创 2019-12-05 15:23:54 · 75 阅读 · 0 评论 -
PAT甲级——A1143 LowestCommonAncestor【30】
The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively defined as a binary tree which has ...原创 2019-12-02 23:10:03 · 131 阅读 · 0 评论 -
PAT甲级——A1068 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. However,...原创 2019-12-02 22:47:32 · 108 阅读 · 0 评论 -
PAT甲级——A1076 Forwards on Weibo【30】
Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a ...原创 2019-12-02 22:09:06 · 130 阅读 · 0 评论 -
PAT甲级——A1053 Path of Equal Weight【30】
Given a non-empty tree with rootR, and with weightWiassigned to each tree nodeTi. Theweight of a path fromRtoLis defined to be the sum of the weights of all the nodes along the path fro...原创 2019-12-02 20:44:24 · 68 阅读 · 0 评论 -
PAT甲级【2019年9月考题】——A1164 DijkstraSequence【30】
7-4 Dijkstra Sequence (30 分)Dijkstra's algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest path problem which gives the shortest paths from one p...原创 2019-11-30 22:48:59 · 311 阅读 · 0 评论 -
PAT甲级【2019年9月考题】——A1163 PostfixExpression【25】
7-3 Postfix Expression (25 分)Given a syntax tree (binary), you are supposed to output the corresponding postfix expression, with parentheses reflecting the precedences of the operators.Input Speci...原创 2019-11-30 22:23:06 · 149 阅读 · 0 评论 -
PAT甲级【2019年9月考题】——A1162 MergingLinkedLists【25】
7-2 Merging Linked Lists (25 分)Given two singly linked lists L1=a1→a2→...→an−1→anL1=a1→a2→...→an−1→an and L2=b1→b2→...→bm−1→bmL2=b1→b2→...→bm−1→bm . If n≥2mn≥2m , you are supp...原创 2019-11-30 22:09:41 · 334 阅读 · 0 评论 -
PAT甲级【2019年9月考题】——A1160 Forever【20】
7-1 Forever (20 分)"Forever number" is a positive integer A with K digits, satisfying the following constrains:the sum of all the digits of A is m; the sum of all the digits of A+1 is n; and the ...原创 2019-11-30 21:53:50 · 341 阅读 · 0 评论 -
PAT甲级——A1098 Insertion or Heap Sort【25】
According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data,...原创 2019-11-30 13:14:43 · 148 阅读 · 0 评论 -
PAT甲级——A1089 Insert or Merge【25】
According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data,...原创 2019-11-30 11:42:12 · 80 阅读 · 0 评论 -
PAT甲级【2019年3月考题】——A1159 Structure_of_a_BinaryTree【30】
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, a binary tree can be uniquely determined.Now given a sequence of state...原创 2019-11-28 22:48:59 · 247 阅读 · 1 评论 -
PAT甲级【2019年3月考题】——A1158 TelefraudDetection【25】
Telefraud(电信诈骗) remains a common and persistent problem in our society. In some cases, unsuspecting victims lose their entire life savings. To stop this crime, you are supposed to write a program to d...原创 2019-11-28 22:29:28 · 86 阅读 · 0 评论 -
PAT甲级【2019年3月考题】——A1157 Anniversary【25】
Zhejiang University is about to celebrate her 122th anniversary in 2019. To prepare for the celebration, the alumni association (校友会) has gathered the ID’s of all her alumni. Now your job is to write ...原创 2019-11-28 22:12:49 · 214 阅读 · 0 评论 -
PAT甲级【2019年3月考题】——A1156 SexyPrimes【20】
Sexy primes are pairs of primes of the form (p, p+6), so-named since “sex” is the Latin word for “six”. (Quoted from http://mathworld.wolfram.com/SexyPrimes.html)Now given an integer, you are suppos...原创 2019-11-28 21:55:29 · 204 阅读 · 0 评论 -
PAT甲级——A1155 HeapPaths【30】
In computer science, aheapis a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...原创 2019-11-26 22:56:58 · 64 阅读 · 0 评论