A reversible prime in any number system is a prime whose “reverse” in that number system is also a prime. For example in the decimal system[……]
标签归档:Python3
1065 A+B and C (64bit) (PTA)
Given three integers A, B and C in [−263,263], you are supposed to tell whether A+B>C.
Input Specification:
[……]
1028 List Sorting (PTA)
Excel can sort records according to any column. Now you are supposed to imitate this function.
Input Specification:
Each input file contains one[……]
1031 Hello World for U (PTA)
Given any string of N (≥5) characters, you are asked to form the characters into the shape of U
. For example, helloworld
can[……]
1009 Product of Polynomials (PTA)
This time, you are supposed to find A×B where A and B are two polynomials.
Input Specification:
Each input file co[……]
02-线性结构4 Pop Sequence (PTA)
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[……]
02-线性结构3 Reversing Linked List (PTA)
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For examp[……]
02-线性结构2 一元多项式的乘法与加法运算 (PTA)
设计函数分别求两个一元多项式的乘积与和。
输入格式:
输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。
输出格式:
输出分2行,分别以指数递降方式输出乘积多项式以及和多项式非零项[……]
1002 A+B for Polynomials (PTA)
This time, you are supposed to find A+B where A and B are two polynomials.
Input Specification:
Each input file co[……]
1001 A+B Format (PTA)
Calculate a+b and output the sum in standard format — that is, the digits must be separated into groups of three by commas (unless there ar[……]