-
Pat 甲级 训练真题集 1052!
1052. Linked List Sorting (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueA linked list consists of a series of structures, which are not necessarily adjacent in memory. We a...…
-
Pat 甲级 训练真题集 1051!
1051. Pop Sequence (25) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueGiven a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop random...…
-
Pat 甲级 训练真题集 1117!
1050. String Subtraction (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueGiven two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the ch...…
-
Pat 甲级 训练真题集 1117!
1117. Eddington Number(25) 时间限制 250 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueBritish astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he ha...…
-
Pat 甲级 训练真题集 1108&1116!
1108. Finding Average (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueThe basic task is simple: given N real numbers, you are supposed to calculate their average. But what ma...…
-
Pat 甲级 训练真题集 1101&1102!
1101. Quick Sort (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CAO, PengThere is a classical process named partition in the famous quick sort algorithm. In this process we typically ...…
-
Pat 甲级 训练真题集 1104&1105!
1104. Sum of Number Segments (20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CAO, PengGiven a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For e...…
-
Pat 甲级 训练真题集 1122!
1122. Hamiltonian Cycle (25) 时间限制 300 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueThe “Hamilton cycle problem” is to find a simple cycle that contains every vertex in a graph. Such a c...…
-
Pat 甲级 训练真题集 1121!
1121. Damn Single (25) 时间限制 300 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue“Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those ...…
-
Pat 甲级 训练真题集 1120!
1120. Friend Numbers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueTwo integers are called “friend numbers” if they share the same sum of their digits, and the sum is their ...…
-
Pat 甲级 训练真题集 1042!
1042. Shuffling Machine (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueShuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniq...…
-
Pat 甲级 训练真题集 1041!
1041. Be Unique (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueBeing unique is so important to people on Mars that even their lottery is designed in a unique way. The rule o...…
-
Pat 甲级 训练真题集 1040!
1040. Longest Symmetric String (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueGiven a string, you are supposed to output the length of the longest symmetric sub-string. For e...…
-
Pat 甲级 训练真题集 1039!
1039. Course List for Student (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueZhejiang University has 40000 students and provides 2500 courses. Now given the student name list...…
-
Pat 甲级 训练真题集 1038!
1038. Recover the Smallest Number (30)Given 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...…
-
Pat 甲级 训练真题集 1037!
1037. Magic Coupon (25)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...…
-
Pat 甲级 训练真题集 1036!
1036. Boys vs Girls (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueThis time you are asked to tell the difference between the lowest grade of all the male students and the hi...…
-
Pat 甲级 训练真题集 1035!
1035. Password (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, YueTo prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that the...…
-
Pat 甲级 训练真题集 1032!
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 ...…
-
Pat 甲级 训练真题集 1031!
1031. Hello World for U (20)Given 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 rlowo That is, the characters must be printed in th...…