自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

一个非计算机专业的 博客

一个非计算机专业的 国企员工

  • 博客(37)
  • 收藏
  • 关注

原创 PAT A1138 2019.07.31 【前中序列建树】

1138Postorder 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-07-31 15:47:17 235

原创 PAT A1043 2019.07.29 【BST建树】

1043Is It a Binary Search Tree(25分)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...

2019-07-29 17:20:47 110

原创 PAT A1086 2019.07.28 【先中序列建树 模拟栈建树】

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-07-28 15:07:04 346

原创 PAT A1020 2019.07.26 【后中序列建树 层次遍历】

1020Tree Traversals(25分)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 ...

2019-07-26 15:51:50 184

原创 PAT A1085 2019.07.21 【sort】

1085Perfect Sequence(25分)Given a sequence of positive integers and another positive integerp. The sequence is said to be aperfect sequenceifM≤m×pwhereMandmare the maximum and minimum numb...

2019-07-21 15:02:08 133

原创 PAT A1092 2019.07.19 【hash散列】

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-07-19 15:10:33 71

原创 PAT A1012 2019.07.18 【sort 结构体】

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-07-18 18:13:36 117

原创 PAT A1096 2019.07.17 【因式分解】

1096Consecutive Factors(20分)Among 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, where 5, 6, and 7 are the thre...

2019-07-17 16:39:30 66

原创 PAT A1084 2019.07.17 【hash散列】

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-07-17 14:40:31 120

原创 PAT A1104 2019.07.16 【水题】

1104Sum of Number Segments(20分)Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segme...

2019-07-16 19:50:26 129

原创 PAT A1082 2019.07.16 【string】

1082Read Number in Chinese(25分)Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. OutputFufirst if it is negative. For example, -123456789 ...

2019-07-16 16:46:36 167

原创 PAT A1062 2019.07.15 【sort】

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-07-15 19:47:38 151

原创 PAT A1056 2019.07.14 【水题】

1056Mice and Rice(25分)Mice and Riceis the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each m...

2019-07-14 19:58:25 319

原创 PAT A1019 2019.07.14 【进制转换】

1019General Palindromic Number(20分)A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All sing...

2019-07-14 14:28:05 157

原创 PAT A1051 2019.07.13 【栈模拟】

1051Pop Sequence(25分)Given a stack which can keepMnumbers at most. PushNnumbers in the order of 1, 2, 3, ...,Nand pop randomly. You are supposed to tell if a given sequence of numbers is a ...

2019-07-13 16:05:13 293

原创 PAT A1008 2019.07.13 【水题】

1008Elevator(20分)The highest building in our city has only one elevator. A request list is made up withNpositive numbers. The numbers denote at which floors the elevator will stop, in specified...

2019-07-13 14:00:43 102

原创 PAT A1039 2019.07.12 【vector】

1039Course List for Student(25分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered co...

2019-07-12 16:27:59 132

原创 PAT A1069 2019.07.11 【水题】

1069The Black Hole of Numbers(20分)For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing or...

2019-07-11 17:13:53 138

原创 PAT A1015 2019.07.11 【素数 进制转换】

1015Reversible Primes(20分)Areversible primein 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 beca...

2019-07-11 15:41:57 127

原创 PAT B1013 2019.07.10

1013数素数(20分)令P​i​​表示第i个素数。现任给两个正整数M≤N≤10​4​​,请输出P​M​​到P​N​​的所有素数。输入格式:输入在一行中给出M和N,其间以空格分隔。输出格式:输出从P​M​​到P​N​​的所有素数,每 10 个数字占 1 行,其间以空格分隔,但行末不得有多余空格。输入样例:5 27输出样例:...

2019-07-11 08:24:36 86

原创 PAT B1007 2019.07.10

1007素数对猜想(20分)让我们定义d​n​​为:d​n​​=p​n+1​​−p​n​​,其中p​i​​是第i个素数。显然有d​1​​=1,且对于n>1有d​n​​是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N(<10​5​​),请计算不超过N的满足猜想的素数对的个数。输入格式:输入在一行给出正整数N。输出格式:在一行中...

2019-07-10 15:01:49 144

原创 PAT A1073/B1024 2019.07.07 【字符串处理】

1073Scientific Notation(20分)Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-...

2019-07-07 17:32:07 217

原创 PAT A1061/B1014 2019.07.07 【字符串处理】

1061Dating(20分)Sherlock Holmes received a note with some strange strings:Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that t...

2019-07-07 15:17:51 302

原创 PAT A1001 2019.07.07 【水题】

1001A+B Format(20分)Calculatea+band 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 Spe...

2019-07-07 14:08:35 103

原创 PAT A1036 2019.07.06 【查找】

1036Boys 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.Input Specification:Eac...

2019-07-06 17:22:25 173

原创 PAT A1011 2019.07.06 【水题】

1011World Cup Betting(20分)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...

2019-07-06 16:03:33 138

原创 PAT A1006 2019.07.06 【查找】

1006Sign In and Sign Out(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. Given the reco...

2019-07-06 15:02:31 190

原创 PAT A1009 2019.07.05 【多项式】

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-07-05 17:05:56 208

原创 PAT A1002 2019.07.05 【多项式】

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-07-05 16:29:25 126

原创 PAT B1010 2019.07.05

1010一元多项式求导(25分)设计函数求一元多项式的导数。(注:x​n​​(n为整数)的一阶导数为nx​n−1​​。)输入格式:以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过 1000 的整数)。数字间以空格分隔。输出格式:以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。注意“零多项式”的指数和系数都是 0,但是...

2019-07-05 15:35:31 202

原创 PAT A1065 2019.07.04 【模拟】

1065A+B and C (64bit)(20分)Given three integersA,BandCin [−2​63​​,2​63​​], you are supposed to tell whetherA+B>C.Input Specification:The first line of the input gives the positive num...

2019-07-04 16:43:07 129

原创 PAT B1022 2019.07.04

1022D进制的A+B(20分)输入两个非负 10 进制整数A和B(≤2​^30​​−1),输出A+B的D(1<D≤10)进制数。输入格式:输入在一行中依次给出 3 个整数A、B和D。输出格式:输出A+B的D进制数。输入样例:123 456 8输出样例:1103思路分析基本的进制转换问题,利用栈可以解决...

2019-07-04 16:41:05 73

原创 PAT A1046 2019.07.03 【模拟】

1046Shortest Distance(20分)The task is really simple: givenNexits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specif...

2019-07-03 18:22:19 116

原创 PAT B1012 2019.07.03

1012数字分类(20分)给定一系列正整数,请按要求对数字进行分类,并输出以下 5 个数字:A​1​​= 能被 5 整除的数字中所有偶数的和; A​2​​= 将被 5 除后余 1 的数字按给出顺序进行交错求和,即计算n​1​​−n​2​​+n​3​​−n​4​​⋯; A​3​​= 被 5 除后余 2 的数字的个数; A​4​​= 被 5 除后余 3 的数字的平均数,精...

2019-07-03 18:14:42 59

原创 PAT B1018 2019.07.03

1018锤子剪刀布(20分)大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示:现给出两人的交锋记录,请统计双方的胜、平、负次数,并且给出双方分别出什么手势的胜算最大。输入格式:输入第 1 行给出正整数N(≤10​5​​),即双方交锋的次数。随后N行,每行给出一次交锋的信息,即甲、乙双方同时给出的的手势。C代表“锤子”、J代表“剪刀”、B代...

2019-07-03 18:11:51 177

原创 PAT B1032 2019.07.02

1032挖掘机技术哪家强(20分)为了用事实说明挖掘机技术到底哪家强,PAT 组织了一场挖掘机技能大赛。现请你根据比赛结果统计出技术最强的那个学校。输入格式:输入在第 1 行给出不超过10​5​​的正整数N,即参赛人数。随后N行,每行给出一位参赛者的信息和成绩,包括其所代表的学校的编号(从 1 开始连续编号)、及其比赛成绩(百分制),中间以空格分隔。输出格式:在...

2019-07-03 11:20:21 121

原创 PAT A1042 2019.07.02 【模拟】

1042Shuffling Machine(20分)Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where emp...

2019-07-03 11:13:05 128

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除