PAT advanced
文章平均质量分 76
快乐的野指针
这个作者很懒,什么都没留下…
展开
-
1160 Forever (20 分)测试点2、3
1160 Forever (20 分)“Forever number” is a positive integer A with K digits, satisfying the following constrains:the sum of all the digits of A is m;the sum of all the digits of A+1 is n; andthe greatest common divisor of m and n is a prime number which原创 2022-03-07 12:45:27 · 359 阅读 · 0 评论 -
1129 Recommendation System (25 分)测试点3、4 超时问题
1129 Recommendation System (25 分)Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user’s preference by the number of times that an item has bee原创 2021-09-10 00:17:06 · 211 阅读 · 0 评论 -
1007 Maximum Subsequence Sum (25 分)测试点5
1007 Maximum Subsequence Sum (25 分)Given a sequence of K integers { N1, N2, …, NK}. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj} where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its ele原创 2021-09-07 16:38:41 · 369 阅读 · 1 评论 -
1103 Integer Factorization (30 分)超时问题
1103 Integer Factorization (30 分)Sample Input 1:169 5 2结尾无空行Sample Output 1:169 = 6^2 + 6^2 + 6^2 + 6^2 + 5^2结尾无空行Sample Input 2:169 167 3结尾无空行Sample Output 2:Impossible结尾无空行代码如下#include<cstdio>#include<algorithm>#include<st原创 2021-09-03 15:25:16 · 159 阅读 · 0 评论 -
1052 Linked List Sorting (25 分)测试点4
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原创 2021-09-02 20:55:09 · 203 阅读 · 0 评论 -
1059 Prime Factors (25 分)测试点3、4
1059 Prime Factors (25 分)Given any positive integer N, you are supposed to find all of its prime factors, and write them in the formatN = p1k1*p2k2*…*pm^km.Input Specification:Each input file contains one test case which gives a positive integer原创 2021-08-31 21:12:28 · 365 阅读 · 0 评论 -
1033 To Fill or Not to Fill (25 分)测试点0、1
1033 To Fill or Not to Fill (25 分)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 give di原创 2021-08-29 21:05:47 · 286 阅读 · 1 评论 -
1095 Cars on Campus (30 分)测试点4
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 are supposed to tell, at any s原创 2021-08-27 20:17:01 · 266 阅读 · 0 评论