![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT A
Levyya
这个作者很懒,什么都没留下…
展开
-
1009 Product of Polynomials (25 分)
1009Product of Polynomials(25分)This time, you are supposed to findA×BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines...原创 2019-08-25 09:55:44 · 79 阅读 · 0 评论 -
1084 Broken Keyboard (20 分)——PAT A
1084Broken Keyboard(20分)On 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 screen.Now given a st...原创 2019-09-01 19:52:45 · 103 阅读 · 0 评论 -
1092 To Buy or Not to Buy (20 分)——PAT A
1092To Buy or Not to Buy(20分)Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However th...原创 2019-09-01 20:12:41 · 92 阅读 · 0 评论 -
1050 String Subtraction (20 分)——PAT A
1050String Subtraction(20分)Given two stringsS1andS2,S=S1−S2is defined to be the remaining string after taking all the characters inS2fromS1. Your task is simply to calcu...原创 2019-09-02 16:08:55 · 81 阅读 · 0 评论 -
1048 Find Coins (25 分)——PAT A
1048Find Coins(25分)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 coi...原创 2019-09-02 16:28:53 · 101 阅读 · 0 评论 -
1055 The World's Richest (25 分)——PAT A
1055The World's Richest(25分)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, ...原创 2019-09-02 18:01:07 · 82 阅读 · 0 评论 -
1062 Talent and Virtue (25 分)——PAT A
1062Talent and Virtue(25分)About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outs...原创 2019-09-02 20:57:33 · 88 阅读 · 0 评论 -
1075 PAT Judge (25 分)——PAT A
1075PAT Judge(25分)The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specificati...原创 2019-09-03 14:14:35 · 102 阅读 · 0 评论 -
1083 List Grades (25 分)——PAT A
1083List Grades(25分)Given a list ofNstudent records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student rec...原创 2019-09-03 15:34:32 · 84 阅读 · 0 评论 -
1153 Decode Registration Card of PAT (25 分)
1153Decode Registration Card of PAT(25分)A registration card number of PAT consists of 4 parts:the 1st letter represents the test level, namely,Tfor the top level,Afor advance andBfor basi...原创 2019-09-06 15:10:31 · 96 阅读 · 0 评论 -
1154 Vertex Coloring (25 分)
1154Vertex Coloring(25分)Aproper vertex coloringis a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at mostk...原创 2019-09-06 15:36:31 · 82 阅读 · 0 评论 -
1155 Heap Paths (30 分)——PAT A
1155Heap Paths(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 gre...原创 2019-09-06 16:18:57 · 87 阅读 · 0 评论 -
1079 Total Sales of Supply Chain (25 分)——PAT A
1079Total Sales of Supply Chain(25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starti...原创 2019-08-29 20:21:36 · 88 阅读 · 0 评论 -
1086 Tree Traversals Again (25 分)——PAT A
1086Tree Traversals Again(25分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered ...原创 2019-08-28 23:37:04 · 132 阅读 · 0 评论 -
1090 Highest Price in Supply Chain (25 分)——PAT A
1090Highest Price in Supply Chain(25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Star...原创 2019-08-28 22:17:24 · 104 阅读 · 1 评论 -
1034 Head of a Gang(未解决)——PAT A
1034Head 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 betweenAandB, we say thatAandBis related. The weight of a...原创 2019-08-25 18:06:48 · 72 阅读 · 0 评论 -
1002 A+B for Polynomials——PAT A
1002A+B for Polynomials(25分)This time, you are supposed to findA+BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, a...原创 2019-08-21 14:29:29 · 80 阅读 · 0 评论 -
1003 Emergency (25 分)——PAT A
1003Emergency(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...原创 2019-08-21 15:59:59 · 114 阅读 · 0 评论 -
1012 The Best Rank (25 分)——PAT A
1012The 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 L...原创 2019-08-26 08:08:24 · 122 阅读 · 0 评论 -
1028 List Sorting (25 分)——PAT A
1028List Sorting(25分)Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, t...原创 2019-08-26 10:09:15 · 74 阅读 · 0 评论 -
1115 Counting Nodes in a BST——PAT A
1115Counting Nodes in a BST(30分)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 nodes with keys le...原创 2019-08-27 11:20:05 · 67 阅读 · 0 评论 -
1106 Lowest Price in Supply Chain (25 分)——PAT A
1106Lowest Price in Supply Chain(25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Start...原创 2019-08-28 16:33:04 · 64 阅读 · 0 评论 -
1102 Invert a Binary Tree (25 分)——PAT A
1102Invert a Binary Tree(25分)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...原创 2019-08-28 20:51:29 · 59 阅读 · 0 评论 -
1094 The Largest Generation (25 分)——PAT A
1094The Largest Generation(25分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation ...原创 2019-08-28 21:28:17 · 108 阅读 · 0 评论 -
1142 Maximal Clique (25 分)——PAT A
1142Maximal Clique(25分)Acliqueis a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. Amaximal cliqueis a clique that cannot be extend...原创 2019-09-07 10:25:39 · 109 阅读 · 0 评论