自定义博客皮肤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-A1029 Median

A1029 MedianGiven an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9, 10, 15, 16, 17 } is 15. The median of two sequences is defined

2021-10-19 14:28:19 122

原创 PAT-A1044 Shopping in Mars (25 分)

A1044 Shopping in Mars (25 分)Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can be cut at any position for only once and some of

2021-09-28 19:47:17 112

原创 PAT-A1085 Perfect Sequence (完美数列)

A1085 Perfect Sequence (完美数列)Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the maximum and minimum numbers in the sequence, respectively.Now given a sequence

2021-09-27 19:08:40 127

原创 PAT-A1038 Recover the Smallest Number

A1038 Recover the Smallest NumberGiven a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229-87 or 0229-32-87-321-

2021-09-27 17:43:44 99

原创 PAT-A1067 Sort with Swap(0, i)

A1067 Sort with Swap(0, i)Given any permutation of the numbers {0, 1, 2,…, N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2, 1, 3} we may apply the swap o

2021-09-26 20:19:06 70

原创 PAT-A1037 Magic Coupon

A1037 Magic CouponThe magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that product back! What is more, the shop also offe

2021-09-26 18:25:35 78

原创 PAT-A1070 Mooncake (结构体+排序)

A1070 Mooncake (结构体+排序)Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region’s culture. Now given the inventory amounts and

2021-09-26 17:21:25 100

原创 PAT-A1048 Find Coins (寻找硬币)

A1048 Find Coins (寻找硬币)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, there was a special requirement

2021-09-25 18:22:40 90

原创 PAT-A1050 String Subtraction (字符串相关的散列)

A1050 String Subtraction (字符串相关的散列)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 calculate S1−S2 for any given strings. However, it might not be that simple

2021-09-25 17:31:33 71

原创 PAT-A1041 Be Unique

A1041 Be UniqueBeing unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,104]. The first one who bets on a unique number wins. For example, if the

2021-09-25 16:45:05 82

原创 PAT-A1092 To Buy or Not to Buy (买或者不买珠子)

A1092 To Buy or Not to Buy (买或者不买珠子)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 the owner of the shop would only sell the strings in wh

2021-09-25 15:21:46 104

原创 PAT- A1084 Broken Keyboard (旧键盘)

A1084 Broken Keyboard (旧键盘)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 string that you are supposed to type, and the string that yo

2021-09-25 14:37:27 66

原创 PAT-A1083 List Grades

A1083 List GradesGiven a list of N student 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 records of which the grades are in a given interval.Input Specifi

2021-09-24 15:09:24 65

原创 PAT-A1055 The World‘s Richest

A1055 The World’s RichestForbes 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, but concentrate only on the people in a certain range of ages.

2021-09-24 14:46:09 98

原创 PAT-A1028 List Sorting (多种排序条件)

A1028 List Sorting (多种排序条件)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, the first line contains two integers N (≤105) and C, wher

2021-09-20 16:52:27 80

原创 PAT-A1062 Talent and Virtue (德才论)

A1062 Talent and Virtue (德才论)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 outstanding in both talent and virtue must be a “sage(圣人)”; b

2021-09-19 20:54:35 111

原创 PAT-A1082 Read Number in Chinese (中文读数字)

A1082 Read Number in Chinese (中文读数字)Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Q

2021-09-19 20:43:52 69

原创 PAT-A1077 Kuchiguse

A1077 Kuchiguse (找字符串相同字符串)The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is often exa

2021-09-18 19:48:39 82

原创 PAT-A1035 Password (密码替换)

A1035 Password (密码替换)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O

2021-09-18 17:08:23 69

原创 PAT-A1005 Spell It Right (正确拼写)

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. Each case occupies one line which

2021-09-17 21:22:33 87

原创 PAT-A1001 A+B Format (A+B的格式)

A1001 A+B Format (A+B的格式)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 file contains one test case. Each

2021-09-17 20:04:50 149

原创 PAT-A1073 Scientific Notation (科学计数法)

A1073 Scientific Notation (科学计数法)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[±][0-9]+ which means that the integer portion has exactly

2021-09-15 21:49:55 170

原创 PAT- A1061 Dating (福尔摩斯的约会)

A1061 Dating (福尔摩斯的约会)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 those strange strings are actually referring to the co

2021-09-15 18:11:06 77

原创 PAT-A1058 A+B in Hogwarts (钱币转换)

A1058 A+B in Hogwarts (钱币转换)If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it’s easy enough.” You

2021-09-13 21:25:05 84

原创 PAT- A1027 Colors in Mars

A1027 Colors in Mars (13进制)People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last

2021-09-13 18:29:00 62

原创 PAT-A1019 General Palindromic Number (进制转换+回文串)

A1019 General Palindromic Number (进制转换+回文串)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 numbers.Although p

2021-09-13 17:51:55 55

原创 PAT-A1031 Hello World for U

A1031 Hello World for UGiven any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat is, the characters must be printed in the original order, starting

2021-09-12 21:30:30 91

原创 PAT-A1036 Boys vs Girls (男孩VS女孩)

A1036 Boys vs Girls (男孩VS女孩)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:Each input file contains one test case. Each case contains

2021-09-12 21:09:11 111

原创 PAT-A1006 Sign In and Sign Out (最早和最晚)

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, you are supposed to find

2021-09-12 20:11:16 102

原创 PAT-A1011 World Cup Betting (世界杯赔率)

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. Similarly, football bettin

2021-09-11 22:50:24 676

原创 PAT-A1009 Product of Polynomials (多项式乘法)

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 information of a polynomial:

2021-09-11 21:25:18 92

原创 PAT-A1002 A+B for Polynomials (多项式加法)

A1002 A+B for 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 information of a polynomial:K

2021-09-11 19:30:15 131

原创 PAT-A1065 A+B and C (长整型比较)

A1065 A+B and C (长整型比较)Given three integers A, B and C in (−263,263), you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the positive number of test cases, T (≤10). Then T test cases follow, each consists of

2021-09-10 22:45:35 88

原创 PAT-A1046 Shortest Distance(最短距离)

A1046 Shortest Distance (最短距离)The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Each input file contains one test case. For each

2021-09-10 21:18:32 124

原创 PAT甲级备考模板持续整理中。。。

拖了很久,我终于来写了。

2021-09-10 19:42:43 235

原创 PAT-A1042 Shuffling Machine (卡片交换)

A1042 Shuffling Machine (卡片交换)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 employees collaborate with gamblers by performing inadequat

2021-09-10 19:30:57 62

原创 软考-2021年上半年中级软件设计师备考经验分享(已过!)

这篇文章算是我整个软考的回顾吧,先在此声明,这篇文章不仅适合于准备下半年考试的同学也同样适合于对自己的大学生涯有些迷茫的,不知道现在该做些什么的同学阅读。对此我会从下面几个方面来讲述我的一些心得体会。(ps:准备考试的老哥请直接跳到学习历程)文章目录为什么要去考软考?学习历程关于考试的准备为什么要去考软考?软考全名是中国计算机技术与软件专业技术资格水平考试,由人社部和工信部举办的国家级考试,它分为初,中,高三个级别,一年两次,考试分为上午题和下午题,要都通过才行。计算机专业的证书说实话并不是很多

2021-09-10 19:20:45 1360 9

空空如也

空空如也

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

TA关注的人

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