- 博客(66)
- 收藏
- 关注
原创 PAT (Basic Level) Practice (中文)1101 B是A的多少倍 (15 分)
设一个数 AAA 的最低 DDD 位形成的数是 ada_dad 。如果把 ada_dad 截下来移到 AAA 的最高位前面,就形成了一个新的数 BBB。BBB 是 AAA 的多少倍?例如将 12345 的最低 2 位 45 截下来放到 123 的前面,就得到 45123,它约是 12345 的 3.66 倍。输入格式输入在一行中给出一个正整数 A(≤109)A(≤10^9 )A(≤109)和要截取的位数 D。题目保证 D 不超过 A 的总位数输出格式计算 B 是 A 的多少倍,输出小数点后 2
2022-03-11 11:13:35 413
原创 PAT (Advanced Level) Practice 1101 Quick Sort (25 分)
PAT A1101 Quick Sort
2022-03-07 10:44:53 210
原创 PAT (Advanced Level) Practice 1038 Recover the Smallest Number (30 分)
PAT甲级 A1038 Recover the Smallest Number
2021-12-25 13:16:04 80
原创 PAT (Advanced Level) Practice 1067 Sort with Swap(0, i) (25 分)
PAT甲级 A1067 Sort with Swap(0,i)
2021-12-23 20:03:11 178
原创 PAT (Advanced Level) Practice 1085 Perfect Sequence (25 分)
PAT甲级练习A1085 Perfect Sequence
2021-12-23 08:34:11 389
原创 PAT (Advanced Level) Practice 1069 The 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 order, a new number can be obtained by taking the second number from the first one. Repeat in this m
2021-12-22 21:17:32 114
原创 PAT (Advanced Level) Practice 1029 Median (25 分)
Given 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 to be the me
2021-12-21 19:06:22 71
原创 PAT (Advanced Level) Practice 1010 Radix (25 分)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integers N1N_1N1 and N2N_2N2, your task is to find the r
2021-12-20 14:02:10 77
原创 PAT (Advanced Level) Practice 1001 A+B Format (20 分)
Calculate a+ba+ba+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 case contains a pai
2021-12-20 11:16:57 134
原创 PAT (Advanced Level) Practice 1097 Deduplication on a Linked List (25 分)
Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the value or absolute value of its key equals K will be kept. At the m
2021-12-19 09:01:54 81
原创 PAT (Advanced Level) Practice 1052 Linked List Sorting (25 分)
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure. Now given a linked list, you are supposed to sort the structures
2021-12-18 16:19:32 474
原创 PAT (Advanced Level) Practice 1032 Sharing (25 分)
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example, loading and being are stored as showed in Figure 1.Yo
2021-12-18 15:20:46 627
原创 PAT (Advanced Level) Practice 1074 Reversing Linked List (25 分)
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2→1→5→6.Input Specification:Each
2021-12-17 11:25:10 458
原创 PAT (Advanced Level) Practice 1051 Pop Sequence (25 分)
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 and N is 7, we can obtain
2021-12-17 11:09:36 246
原创 PAT (Advanced Level) Practice 1022 Digital Library (30 分)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number as its ID. Given any query from a reader, you are suppose
2021-12-16 23:11:41 214
原创 PAT (Advanced Level) Practice 1071 Speech Patterns (25 分)
People often have a preference among synonyms of the same word. For example, some may prefer “the police”, while others may prefer “the cops”. Analyzing such patterns can help to narrow down a speaker’s identity, which is useful when validating, for exampl
2021-12-16 08:58:22 63
原创 PAT (Advanced Level) Practice 1054 The Dominant Color (20 分)
Behind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. A strictly dominant color takes more than
2021-12-15 11:14:03 479
原创 PAT (Advanced Level) Practice 1100 Mars Numbers (20 分)
People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, respectively.For the next higher digit, Mars people name
2021-12-15 10:55:45 728
原创 PAT (Advanced Level) Practice 1095 Cars on Campus (30 分)
PAT (Advanced Level) Practice 1095 Cars on Campus (30 分)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
2021-12-14 11:19:27 975
原创 PAT (Advanced Level) Practice 1080 Graduate Admission (30 分)
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 applicant will have to provide two grad
2021-12-13 20:10:01 106
原创 PAT (Advanced Level) Practice 1083 List Grades (25 分)
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.Input Specification:Each input
2021-12-13 01:16:27 689
原创 PAT (Advanced Level) Practice 1075 PAT 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 Specification:Each input file contains one test case. For each case, the first line contai
2021-12-13 00:05:35 1041
原创 PAT (Advanced Level) Practice 1055 The World‘s Richest (25 分)
PAT (Advanced Level) Practice 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, but concentrate only on the
2021-12-12 10:18:05 351
原创 PAT (Advanced Level) Practice 1028 List Sorting (25 分)
PAT (Advanced Level) Practice 1028 List 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, the first line contains two in
2021-12-12 09:23:09 73
原创 PAT (Advanced Level) Practice 1016 Phone Bills (25 分)
PAT (Advanced Level) Practice 1016 Phone Bills (25 分)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
2021-12-11 21:08:41 212
原创 PAT (Advanced Level) Practice 1082 Read Number in Chinese (25 分)
PAT (Advanced Level) Practice 1082 Read Number in Chinese (25 分)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
2021-12-10 23:51:58 141
原创 PAT (Advanced Level) Practice 1077 Kuchiguse (20 分)
PAT (Advanced Level) Practice 1077 Kuchiguse (20 分)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 “Kuc
2021-12-10 11:41:45 69
原创 PAT (Advanced Level) Practice 1025 PAT Ranking (25 分)
PAT甲级 1025 PAT Ranking (25 分)2021年12月10日10:31:43Programming 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
2021-12-10 10:32:36 336
原创 PAT (Basic Level) Practice (中文)1073 多选题常见计分法 (20 分)
PAT (Basic Level) Practice (中文)1073 多选题常见计分法 (20 分)批改多选题是比较麻烦的事情,有很多不同的计分方法。有一种最常见的计分方法是:如果考生选择了部分正确选项,并且没有选择任何错误选项,则得到 50% 分数;如果考生选择了任何一个错误的选项,则不能得分。本题就请你写个程序帮助老师批改多选题,并且指出哪道题的哪个选项错的人最多。输入格式输入在第一行给出两个正整数 N(≤1000)和 M(≤100),分别是学生人数和多选题的个数。随后 M 行,每行顺次给出一道
2021-12-09 11:44:25 119
原创 PAT (Basic Level) Practice (中文)1055 集体照 (25 分)
PAT (Basic Level) Practice (中文)1055 集体照 (25 分)拍集体照时队形很重要,这里对给定的 N 个人 K 排的队形设计排队规则如下:每排人数为 N/K(向下取整),多出来的人全部站在最后一排;后排所有人的个子都不比前排任何人矮;每排中最高者站中间(中间位置为 m/2+1,其中 m 为该排人数,除法向下取整);每排其他人以中间人为轴,按身高非增序,先右后左交替入队站在中间人的两侧(例如5人身高为190、188、186、175、170,则队形为175、188、19
2021-12-08 22:49:11 76
原创 PAT (Basic Level) Practice (中文)1079 延迟的回文数 (20 分)
PAT (Basic Level) Practice (中文)1079 延迟的回文数 (20 分)
2021-12-08 18:30:16 64
原创 PAT (Basic Level) Practice (中文)1060 爱丁顿数 (25 分)
PAT (Basic Level) Practice (中文)1060 爱丁顿数 (25 分)英国天文学家爱丁顿很喜欢骑车。据说他为了炫耀自己的骑车功力,还定义了一个“爱丁顿数”EEE ,即满足有EEE天骑车超过EEE英里的最大整数EEE。据说爱丁顿自己的EEE等于87。现给定某人 NNN 天的骑车距离,请你算出对应的爱丁顿数E(≤N)E(≤N)E(≤N)。输入格式输入第一行给出一个正整数 N(≤105)N (≤10^5 )N(≤105),即连续骑车的天数;第二行给出 NNN 个非负整数,代表每天的
2021-12-08 16:08:29 124
原创 PAT (Basic Level) Practice (中文)1052 卖个萌 (20 分)
萌萌哒表情符号通常由“手”、“眼”、“口”三个主要部分组成。简单起见,我们假设一个表情符号是按下列格式输出的:[左手]([左眼][口][右眼])[右手]现给出可选用的符号集合,请你按用户的要求输出表情。输入格式输入首先在前三行顺序对应给出手、眼、口的可选符号集。每个符号括在一对方括号[]内。题目保证每个集合都至少有一个符号,并不超过 10 个符号;每个符号包含 1 到 4 个非空字符。之后一行给出一个正整数 K,为用户请求的个数。随后 K 行,每行给出一个用户的符号选择,顺序为左手、左眼、口、右
2021-12-08 15:57:18 71
原创 PAT (Basic Level) Practice (中文)1094 谷歌的招聘 (20 分)
PAT (Basic Level) Practice (中文)1094 谷歌的招聘 (20 分)2004 年 7 月,谷歌在硅谷的 101 号公路边竖立了一块巨大的广告牌(如下图)用于招聘。内容超级简单,就是一个以 .com 结尾的网址,而前面的网址是一个 10 位素数,这个素数是自然常数 e 中最早出现的 10 位连续数字。能找出这个素数的人,就可以通过访问谷歌的这个网站进入招聘流程的下一步。自然常数 e 是一个著名的超越数,前面若干位写出来是这样的e = 2.7182818284590452353
2021-12-08 12:25:46 173
原创 PAT (Basic Level) Practice (中文)1091 N-自守数 (15 分)
如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如3×922=253923×92^2=253923×922=25392,而253922539225392的末尾两位正好是929292,所以929292是一个333-自守数。本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。输入格式输入在第一行中给出正整数MMM(≤20),随后一行给出MMM个待检测的、不超过 1000 的正整数。输出格式对每个需要检测的数字,如果它是NNN-自守数就
2021-12-08 10:51:58 267
原创 PAT (Basic Level) Practice (中文)1086 就不告诉你 (15 分)
PAT (Basic Level) Practice (中文)1086 就不告诉你 (15 分)做作业的时候,邻座的小盆友问你:“五乘以七等于多少?”你应该不失礼貌地围笑着告诉他:“五十三。”本题就要求你,对任何一对给定的正整数,倒着输出它们的乘积。输入格式输入在第一行给出两个不超过 1000 的正整数 A 和 B,其间以空格分隔。输出格式在一行中倒着输出 A 和 B 的乘积。输入样例5 7输出样例53思路计算结果之后转为字符串reverse输出的时候不要输出前导零AC
2021-12-08 00:08:17 149
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人