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 M[……]
分类:PAT
1009. Product of Polynomials (25)-PAT甲级真题
This time, you are supposed to find A*B where A and B are two polynomials.
Input Specification:
Each input file contains one test case. Each case oc[……]
1113. Integer Set Partition (25)-PAT甲级真题
Given a set of N (> 1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n2 numbers, respectively. Let S[……]
1114. Family Property (25)-PAT甲级真题(并查集)
This time, you are supposed to help us collect the data for family-owned property. Given each person’s family members, and the estate(房产)info under hi[……]
1112. Stucked Keyboard (20)-PAT甲级真题
On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep[……]
1110. Complete Binary Tree (25)-PAT甲级真题(BFS)
Given a tree, you are supposed to tell if it is a complete binary tree.
Input Specification:
Each input file contains one test case. For each case,[……]
1116. Come on! Let’s C (20)-PAT甲级真题
“Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of th[……]
1117. Eddington Number(25)-PAT甲级真题
British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an “Eddington number”, E — that[……]
1118. Birds in Forest (25)-PAT甲级真题(并查集)
Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are[……]
1119. Pre- and Post-order Traversals (30)-PAT甲级真题(前序后序转中序)
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino[……]