- 博客(6)
- 收藏
- 关注
原创 PAT甲级1074 C++
PAT甲级1074 题目描述 Given a constant KKK and a singly linked list LLL, you are supposed to reverse the links of every KKK elements on LLL. For example, given L being 1→2→3→4→5→61→2→3→4→5→61→2→3→4→5→6, if K=3K=3K=3, then you must output 3→2→1→6→5→43→2→1→6→5→43→2
2021-10-03 18:19:44
116
原创 PAT甲级1051 C++
PAT甲级1051 题目描述 Given a stack which can keep MMM numbers at most. Push NNN numbers in the order of 1,2,3,...,N1, 2, 3, ..., N1,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 e
2021-10-01 17:29:53
183
原创 PAT甲级1022 C++
PAT甲级1022 题目描述 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,
2021-09-30 19:40:07
129
原创 PAT乙级1012
PAT1012 题目描述: 给定一系列正整数,请按要求对数字进行分类,并输出以下 5 个数字: A1=A_1=A1= 能被 5 整除的数字中所有偶数的和; A2=A_2=A2= 将被 5 除后余 1 的数字按给出顺序进行交错求和,即计算n1−n2+n3−n4⋯n_1-n_2+n_3-n_4⋯n1−n2+n3−n4⋯ A3=A_3=A3= 被 5 除后余 2 的数字的个数; A4=A_4=A4= 被 5 除后余 3 的数字的平均数,精确到小数点后 1 位; A5=A_5=A5= 被 5 除
2021-06-09 21:03:37
115
原创 PAT乙级1011
PAT1011 题目描述: 给定区间[−231,231][-2^{31}, 2^{31}][−231,231]内的3个整数A、BA、BA、B和CCC,请判断A+BA + BA+B是否大于CCC。 输入格式: 输入第 1 行给出正整数T(≤10)T(≤10)T(≤10),是测试用例的个数。随后给出TTT组测试用例,每组占一行,顺序给出A、BA、BA、B和CCC。整数间以空格分隔。 输出格式: 对每组测试用例,在一行中输出Case #X: true如果 A+B>CA+B>CA+B>C,否则输出
2021-06-06 08:23:51
112
2
原创 PAT乙级1010
PAT1010 设计函数求一元多项式的导数。 poly = list(map(int, input().split())) length = len(poly) poly.append(poly[len(poly) - 2]) res = [poly[i] * poly[i + 1] if i % 2 == 0 else poly[i] - 1 for i in range(length) if poly[i] and poly[i + 1]] print(' '.join(list(map(str, re
2021-06-04 20:52:10
101
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅