自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

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

PAT 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 a

2021-08-09 01:01:45 81

原创 PAT-1038-Recover the Smallest Number

PAT 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 ap

2021-08-08 23:49:27 95

原创 PAT-A1037-Magic Coupon

PAT Magic Coupon - 题目链接题目描述 The 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

2021-08-08 19:29:28 112

原创 PAT-A1033-To Fill or Not to Fill

PAT To Fill or Not to Fill - 题目链接题目描述 With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different gas station may

2021-08-08 15:43:58 117

原创 PAT-B1020-月饼

PAT 月饼 - 题目链接题目描述 月饼是中国人在中秋佳节时吃的一种传统食品,不同地区有许多不同风味的月饼。现给定所有种类月饼的库存量、总售价、以及市场的最大需求量,请你计算可以获得的最大收益是多少。 注意:销售时允许取出一部分库存。样例给出的情形是这样的:假如我们有 3 种月饼,其库存量分别为 18、15、10 万吨,总售价分别为 75、72、45 亿元。如果市场的最大需求量只有 20 万吨,那么我们最大收益策略应该是卖出全部 15 万吨第 2 种月饼、以及 5 万吨第 3 种月饼,获得 72

2021-08-07 13:12:05 155

原创 PAT-B1023-组个最小数

PAT 组个最小数 - 题目链接题目描述 给定数字 0-9 各若干个。你可以以任意顺序排列这些数字,但必须全部使用。目标是使得最后得到的数尽可能小(注意 0 不能做首位)。例如:给定两个 0,两个 1,三个 5,一个 8,我们得到的最小的数就是 10015558。现给定数字,请编写程序输出能够组成的最小的数。输入描述 输入在一行中给出 10 个非负整数,顺序表示我们拥有数字 0、数字 1、……数字 9 的个数。整数间用一个空格分隔。10 个数字的总个数不超过 50,且至少拥有 1 个非 0

2021-08-07 12:18:48 145

原创 PAT-A1048-Find Coins

PAT 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 requi

2021-08-05 09:45:33 84

原创 PAT-B1005-继续3n+1猜想

PAT 继续(3n+1)猜想 - 题目链接题目描述 卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对 n=3 进行验证的时候,我们需要计算 3、5、8、4、2、1,则当我们对 n=5、8、4、2 进行验证的时候,就可以直接判定卡拉兹猜想的真伪,而不需要重复计算,因为这 4 个数已经在验证3的时候遇到过了,我们称 5、8、4、2 是被 3“覆盖”的数。我们称一个数列中的某个

2021-08-04 23:53:21 74

原创 PAT-A1050-String Subtraction

PAT String Subtraction - 题目链接题目描述 Given two strings S 1​ and S 2 , S=S 1​ −S 2 is defined to be the remaining string after taking all thecharacters in S 2​ from S 1 . Your task is simply to calculate S 1​ −S 2​ for any given strings. However, it mi

2021-08-04 22:59:54 151

原创 PAT-A1041-Be Unique

PAT Be Unique - 题目链接题目描述 Being 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,10e4 ]. The first one who bets on a unique number wins. For

2021-08-04 22:28:44 67

原创 PAT-B1047-编程团体赛

PAT 编程团体赛 - 题目链接题目描述 编程团体赛的规则为:每个参赛队由若干队员组成;所有队员独立比赛;参赛队的成绩为所有队员的成绩和;成绩最高的队获胜。现给定所有队员的比赛成绩,请你编写程序找出冠军队。输入描述 输入第一行给出一个正整数 N(≤10 e4 ),即所有参赛队员总数。随后 N 行,每行给出一位队员的成绩,格式为:队伍编号-队员编号 成绩,其中队伍编号为 1 到 1000 的正整数,队员编号为 1 到 10 的正整数,成绩为 0 到 100 的整数。输出描述 在一行中

2021-08-04 20:25:54 148

原创 PAT-B1043-输出PATest

PAT 输出PATest - 题目链接题目描述 给定一个长度不超过 10e4的、仅由英文字母构成的字符串。请将字符重新调整顺序,按 PATestPATest… 这样的顺序输出,并忽略其它字符。当然,六种字符的个数不一定是一样多的,若某种字符已经输出完,则余下的字符仍按 PATest 的顺序打印,直到所有字符都被输出。输入描述 输入在一行中给出一个长度不超过 10e4的、仅由英文字母构成的非空字符串。输出描述 在一行中按题目要求输出排序后的字符串。题目保证输出非空。示例:输入

2021-08-04 19:54:21 81

原创 PAT-B1042-字符统计

PAT 字符统计 - 题目链接题目描述 请编写程序,找出一段给定文字中出现最频繁的那个英文字母。输入描述 输入在一行中给出一个长度不超过 1000 的字符串。字符串由 ASCII 码表中任意可见字符及空格组成,至少包含 1 个英文字母,以回车结束(回车不算在内)。输出描述 在一行中输出出现频率最高的那个英文字母及其出现次数,其间以空格分隔。如果有并列,则输出按字母序最小的那个字母。统计时不区分大小写,输出小写字母。示例:输入This is a simple TEST.

2021-08-04 19:29:43 61

原创 PAT-B1039-到底买不买

PAT 到底买不买 - 题目链接题目描述 小红想买些珠子做一串自己喜欢的珠串。卖珠子的摊主有很多串五颜六色的珠串,但是不肯把任何一串拆散了卖。于是小红要你帮忙判断一下,某串珠子里是否包含了全部自己想要的珠子?如果是,那么告诉她有多少多余的珠子;如果不是,那么告诉她缺了多少珠子。 为方便起见,我们用[0-9]、[a-z]、[A-Z]范围内的字符来表示颜色。例如在图1中,第3串是小红想做的珠串;那么第1串可以买,因为包含了全部她想要的珠子,还多了8颗不需要的珠子;第2串不能买,因为没有黑色珠子,并且少

2021-08-04 19:05:13 67

原创 PAT-B1038-统计同成绩学生

PAT -B1038-统计同成绩学生 - 题目链接题目描述 本题要求读入 N 名学生的成绩,将获得某一给定分数的学生人数输出。输入描述 输入在第 1 行给出不超过 10 e5的正整数 N,即学生总人数。随后一行给出 N 名学生的百分制整数成绩,中间以空格分隔。最后一行给出要查询的分数个数 K(不超过 N 的正整数),随后是 K 个分数,中间以空格分隔。输出描述 在一行中按查询顺序给出得分等于指定分数的学生人数,中间以空格分隔,但行末不得有多余空格。示例:输入1060

2021-08-04 12:11:06 81

原创 PAT-B1033-Broken Keyboard

PAT Broken Keyboard - 题目链接题目描述 旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及坏掉的那些键,打出的结果文字会是怎样?输入描述 输入在 2 行中分别给出坏掉的那些键、以及应该输入的文字。其中对应英文字母的坏键以大写给出;每段文字是不超过 10 e5个字符的串。可用的字符包括字母 [a-z, A-Z]、数字 0-9、以及下划线 _(代表空格)、,、.、-、+(代表上档键)。题目保证第 2 行输入的文字串非空。注意

2021-08-04 10:46:44 71

原创 PAT-A1084-Broken Keyboard

PAT 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

2021-08-04 08:56:02 75

原创 PAT-A1095-Cars on Campus

PAT Cars on Campus - 题目链接题目描述 Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the information available, you are supposed to tell, a

2021-08-03 12:43:24 74

原创 PAT-A1080-Graduate Admisson

1080-Graduate Admission - 题目链接题目描述 It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.Each

2021-08-02 23:37:59 92

原创 PAT-A1083-List Grades

PAT List Grades - 题目链接题目描述 Given 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.

2021-08-01 19:33:56 62

原创 PAT-A1002-A+B Format

PAT甲级 1002 A+B Format题目: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).大意:两个数相加 按照每三个数字一组的格式进行标准化输出,使用逗号分隔分析:将结果转换为字符串 根据字符的位置和长度的关系判

2021-08-01 19:12:43 106

原创 PAT-A1075-PAT Judge

PAT-PAT Judge - 题目链接题目描述 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.输入描述 Each input file contains one test case. For each case, the f

2021-08-01 19:08:52 123

原创 PAT-A1055-The World‘s Richest

PAT The World’s Richest - 题目链接题目描述 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, but concentrate only on the people in a certain ra

2021-08-01 14:12:09 81

原创 PAT-A1028-List Sorting

PAT List Sorting - 题目链接题目描述 Excel can sort records according to any column. Now you are supposed to imitate this function.输入描述 Each input file contains one test case. For each case, the first line contains two integers N (≤10 e5) and C, where N is

2021-08-01 11:30:10 78

原创 PAT-A1025-PAT Ranking

PAT Ranking - 题目链接题目描述 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 places, and the ranklists will be merged immediately aft

2021-08-01 01:04:38 62

原创 shell学习笔记

​  大数据程序员为什么需要学习Shell? 1)需要看懂运维人员编写的Shell程序。 2)偶尔会编写一些简单的Shell程序来管理集群、提高开发效率。第1章 Shell概述shell是一个命令行解释器,它接收应用程序/用户命令,然后调用操作系统的内核。Shell还是一个功能强大的编程语言,易编写、调试、灵活性强。第2章 Shell解析器(1)Linux提供的Shell解析器有:(2)bash和sh的关系注意这里Shell解析器的位置存放在/bin 目录下 ,数据比较多 使.

2021-07-31 20:54:39 141

原创 PAT-A1016-Phone Bills

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. When a customer starts connecting

2021-07-31 12:03:20 59

原创 PAT-A1012-The Best Rank

The BestRank - 题目链接题目描述 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 - English. At the mean time, we e

2021-07-29 23:56:56 88

原创 PAT-B1015-德才论

gdgd

2021-07-29 23:25:05 70

空空如也

空空如也

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

TA关注的人

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