PAT(A) 1110. Complete Binary Tree (25)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1110

1110. Complete Binary Tree (25)


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,

继续阅读


PAT(A) 1109. Group Photo (25)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1109

1109. Group Photo (25)


Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following:

The number of people in each row must be N/K (round down to the nearest integer),

继续阅读


PAT(A) 1064. Complete Binary Search Tree (30)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1064

1064. Complete Binary Search Tree (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 the

继续阅读


1063. Set Similarity (25)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1063

1063. Set Similarity (25)


Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets,

继续阅读


PAT(A) 1062. Talent and Virtue (25)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1062

1062. Talent and Virtue (25)


About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man

继续阅读


Pat(A) 1061. Dating (20)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1061

1061. Dating (20)


Sherlock Holmes received a note with some strange strings: "Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm". It took him only a minute to figure out that

继续阅读


Pat(A) 1108. Finding Average (20)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1108

1108. Finding Average (20)


The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be legal. A "legal" input is a real number in [-1000, 1000] and is accurate up to no more than 2 decimal places. When you calculate the average, those illegal numbers must not be counted in.

继续阅读


Pat(A) 1107. Social Clusters (30)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1107

1107. Social Clusters (30)


When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A "social cluster" is a set of people who have some of their hobbies in common. You are supposed to find all the clusters.

Input Specification:

继续阅读


Pat(A) 1106. Lowest Price in Supply Chain (25)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1106

1106. Lowest Price in Supply Chain (25)


A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.

Starting from one root supplier, everyone on the chain buys products from one's supplier in a price P and sell or distribute them in a price that is r%

继续阅读


Pat(A) 1105. Spiral Matrix (25)

原题目:

原题链接:https://www.patest.cn/contests/pat-a-practise/1105

1105. Spiral Matrix (25)


This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the upper-left corner, then move in a clockwise spiral. The matrix has m rows and n columns, where m and n satisfy the following: m*n must be equal to N; m>=n; and m-n is the minimum of all the possible values.

继续阅读


Powered by Django 2. Copyright © 2014.

huchengbei.com. All rights reserved.