PAT
19821220
这个作者很懒,什么都没留下…
展开
-
PAT自主训练记录 甲级A1007 Maximum Subsequence Sum
A1007 Maximum Subsequence Sum(25分)题目描述Given a sequence of K integers { N1N_1N1 , N2N_2N2 , …, NKN_KNK }. A continuous subsequence is defined to be { NiN_iNi , Ni+1N_{i+1}Ni+1 , …, NjN_jNj } where 1≤i≤j≤K. The Maximum Su原创 2020-08-11 17:57:43 · 152 阅读 · 0 评论 -
PAT自主训练记录 甲级A1049 Counting Ones
A1049 Counting Ones(30分)题目描述The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1’s in 1, 10, 11, and 12.Input原创 2020-08-10 10:48:10 · 149 阅读 · 0 评论 -
PAT自主训练记录 乙级B1008 数组元素循环右移问题
B1008 数组元素循环右移问题(20分)题目描述一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置,即将A中的数据由(A0A_0A0A1A_1A1⋯AN−1A_{N−1}AN−1)变换为(AN−MA_{N−M}AN−M⋯AN−1A_{N−1}AN−1A0A_0A0A1A_1A1⋯AN−M−1A_{N−M−1}AN−M−1)(最后M个数循环移至最前面的M个位置)。如果需原创 2020-08-07 16:04:01 · 127 阅读 · 0 评论 -
PAT自主训练记录 甲级A1008 Elevator
A1008 Elevator(20分)题目描述The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up on原创 2020-08-06 18:48:36 · 153 阅读 · 0 评论 -
PAT自主训练记录 甲级A1104/乙级B1049 数列的片段和
A1104 Sum of Number Segments(20分)附有详细解释以及代码的博文链接:https://blog.csdn.net/qq_21394327/article/details/106975016点击跳转题目描述Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2原创 2020-08-05 23:55:28 · 865 阅读 · 0 评论 -
PAT自主训练记录 甲级1093 Count PAT‘s
A1093 Count PAT’S(25分)题目描述The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now given any string, you are sup原创 2020-08-04 13:33:07 · 177 阅读 · 0 评论 -
PAT自主训练记录 甲级1069/乙级1019 The Black Hole of Numbers
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 nu原创 2020-08-04 13:16:47 · 170 阅读 · 0 评论 -
PAT自主训练记录 甲级1029 Median
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 i原创 2020-07-24 15:53:16 · 128 阅读 · 0 评论 -
PAT自主训练记录 甲级1044 Shopping in Mars
1044 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 ...原创 2020-04-29 01:00:46 · 208 阅读 · 0 评论 -
PAT自主训练记录 甲级1048 Find Coins
1048 Find Coins (25分)题目描述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 ...原创 2020-04-28 09:31:33 · 146 阅读 · 0 评论 -
PAT自主训练记录 甲级A1085/乙级B1030 Perfect Sequence/完美数列
A1085 Perfect Sequence (25分)题目描述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...原创 2020-04-27 09:47:04 · 219 阅读 · 0 评论