“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[……]
月份:2020年6月
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[……]
1122. Hamiltonian Cycle (25)-PAT甲级真题
The “Hamilton cycle problem” is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a “Hamiltonian cycle”.
In this p[……]
1124. Raffle for Weibo Followers (20)-PAT甲级真题
John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo — that is, he would select winners from e[……]
PAT 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[……]
PAT 1128. N Queens Puzzle (20)-甲级
The “eight queens puzzle” is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solutio[……]
1120. Friend Numbers (20)-PAT甲级真题
Two integers are called “friend numbers” if they share the same sum of their digits, and the sum is their “friend ID”. For example, 123 and 51 are fri[……]
1121. Damn Single (25)-PAT甲级真题
“Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can[……]