PAT甲级题解
乐行僧丶
这个作者很懒,什么都没留下…
展开
-
PAT(甲级)1141.PAT Ranking of Institutions (25 分)
PAT 1141.PAT Ranking of Institutions (25 分)After each PAT, the PAT Center will announce the ranking of institutions based on their students’ performances. Now you are asked to generate the ranklist....原创 2019-04-06 01:09:37 · 430 阅读 · 1 评论 -
PAT(甲级)1004.Counting Leaves(30)
PAT 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.输入格式:Each input file contains one test case. Each...原创 2019-05-19 22:21:45 · 247 阅读 · 0 评论 -
PAT(甲级)1002.A+B for Polynomials (25)
PAT 1001. A+B Format (20)This time, you are supposed to find A+B where A and B are two polynomials.输入格式:Each input file contains one test case. Each case occupies 2 lines, and each line contains th...原创 2019-05-19 20:24:01 · 195 阅读 · 0 评论 -
PAT(甲级)1001. A+B Format (20)
PAT 1001. 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).输入格式:Eac...原创 2019-05-19 19:19:08 · 216 阅读 · 0 评论 -
PAT(甲级)1055.The World's Richest(25)
PAT 1055.The 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-04-08 23:21:26 · 286 阅读 · 0 评论 -
PAT(甲级)1105.Spiral Maxtrix(25)
PAT 1105 Spiral Matrix(25)This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the uppe...原创 2019-04-08 22:10:09 · 149 阅读 · 0 评论 -
PAT(甲级)1137.Fianl Grading(25)
PAT 1137.Fianl Grading(25)For a student taking the online course “Data Structures” on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain n...原创 2019-04-07 18:11:48 · 277 阅读 · 0 评论 -
PAT(甲级)1036.Boys vs Girls(25)
PAT 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.输入格式:Each input file cont...原创 2019-04-07 14:45:42 · 206 阅读 · 0 评论 -
PAT(甲级)1143. Lowest Common Ancestor(30)
PAT 1143. Lowest Common Ancestor(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...原创 2019-04-07 14:17:05 · 239 阅读 · 0 评论 -
PAT(甲级)1051.LCA in a Binary Tree(30)
PAT 1051.LCA in a Binary Tree(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.Given any two nodes in a binary tree, you ar...原创 2019-04-07 13:52:33 · 197 阅读 · 0 评论 -
PAT(甲级)1025.PAT Ranking(25)
PAT 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 pl...原创 2019-04-07 09:24:00 · 192 阅读 · 0 评论 -
PAT(甲级)1138.Postorder Traversal(25)
PAT 1138.Postorder Traversal(25)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first num...原创 2019-04-07 00:39:57 · 189 阅读 · 0 评论 -
PAT考试 常用技巧(持续更新)
1.字符串中的大小写转换s[i] ^= 32;//位运算,速度快原创 2019-04-06 23:26:34 · 2802 阅读 · 0 评论 -
PAT(甲级)1030.Travel Plan(30)
PAT 1030.Travel Plan(30)A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to d...原创 2019-04-10 20:17:58 · 354 阅读 · 0 评论 -
PAT(甲级)1003.Emergency(25)
PAT 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...原创 2019-04-10 17:53:17 · 241 阅读 · 0 评论 -
PAT(甲级)1121.Damn Single(25)
PAT 1141.PAT Ranking of Institutions (25 分)“Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be tak...原创 2019-04-06 14:05:20 · 219 阅读 · 0 评论 -
PAT(甲级)1050.String Subtraction(20)
PAT 1141.PAT Ranking of Institutions (25 分)Given two strings S1 and S2 , S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calcu...原创 2019-04-06 13:42:52 · 146 阅读 · 0 评论 -
PAT(甲级)1006.Sign In and Sign Out(25)
PAT 1141.PAT Ranking of Institutions (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. Give...原创 2019-04-06 13:25:03 · 344 阅读 · 0 评论 -
PAT(甲级)1005.Spell It Right(20)
PAT 1002.A+B for Polynomials (25)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.输入格式:Each input file contains o...原创 2019-05-19 22:50:34 · 135 阅读 · 0 评论