关闭

PAT 甲级 1124. Raffle for Weibo Followers (20)

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 every N followers who forwarded his post, and give a...
阅读(13) 评论(0)

PAT 甲级 1123. Is It a Complete AVL Tree (30)

An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is...
阅读(22) 评论(0)

PAT 甲级 1122. Hamiltonian Cycle (25)

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 problem, you are supposed to tell if a given cycle is...
阅读(14) 评论(0)

PAT 甲级 1121. Damn Single (25)

“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 be taken care of.Input Specification:Each input fil...
阅读(19) 评论(0)

PAT 甲级 1120. Friend Numbers (20)

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 friend numbers since 1+2+3 = 5+1 = 6, and 6 is their f...
阅读(12) 评论(0)

PAT 甲级 1119. Pre- and Post-order Traversals (30)

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 inorder traversal sequences, or preorder and inorder t...
阅读(22) 评论(0)

PAT 甲级 1118. Birds in Forest (25)

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 supposed to help the scientists to count the maxim...
阅读(16) 评论(0)

PAT 甲级 1117. Eddington Number(25)

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 is, the maximum integer E such that it is for E da...
阅读(25) 评论(0)

PAT 甲级 1116. Come on! Let's C (20)

“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 the contest is for fun, the award rules are funny as...
阅读(22) 评论(0)

PAT 甲级 1115. Counting Nodes in a BST (30)

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than or equal to the node’s key. The...
阅读(26) 评论(0)

PAT 甲级 1114. Family Property (25)

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 his/her own name, we need to know the size of each fa...
阅读(27) 评论(0)

PAT 甲级 1113. Integer Set Partition (25)

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 S1 and S2 denote the sums of all the numbers in A1...
阅读(23) 评论(0)

PAT 甲级 1112. Stucked Keyboard (20)

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 repeatedly on screen for k times.Now given a resulting...
阅读(21) 评论(0)

PAT甲级 1111. Online Map (30)

Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other is the fastest. It is gu...
阅读(19) 评论(0)

PAT 甲级 1110. Complete Binary Tree (25)

PAT 甲级 完全二叉树...
阅读(36) 评论(0)
138条 共10页1 2 3 4 5 ... 下一页 尾页
    个人资料
    • 访问:4811次
    • 积分:1366
    • 等级:
    • 排名:千里之外
    • 原创:136篇
    • 转载:2篇
    • 译文:0篇
    • 评论:0条