PAT甲级
文章平均质量分 62
飞哥小佛与泰瑞
这个作者很懒,什么都没留下…
展开
-
《PAT甲级词汇》
平时刷题积累的词汇,欢迎参考。digit 数字comma 逗号specification 规范intege原创 2021-02-22 22:50:40 · 310 阅读 · 0 评论 -
PAT A1066 Root of AVL Tree (25分)
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...原创 2020-03-31 18:57:03 · 260 阅读 · 0 评论 -
PAT A1053 Path of Equal Weight (30分)
Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from R t...原创 2020-03-28 20:37:23 · 277 阅读 · 0 评论 -
PAT A1004 Counting Leaves (30分)
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts w...原创 2020-03-28 13:08:38 · 246 阅读 · 0 评论 -
PAT A1079 Total Sales of 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...原创 2020-03-27 23:25:28 · 215 阅读 · 0 评论 -
PAT A1100 Mars Numbers (20分)
People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, re...原创 2020-03-16 18:27:44 · 194 阅读 · 0 评论 -
PAT A1023 Have Fun with Numbers (20分)
Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number con...原创 2020-03-12 16:31:06 · 211 阅读 · 0 评论 -
PAT A1081 Rational Sum (20分)
Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts with a positive integ...原创 2020-03-09 21:29:09 · 322 阅读 · 2 评论 -
PAT A1101 Quick Sort (25分)
There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to its le...原创 2020-03-07 14:28:56 · 202 阅读 · 0 评论 -
PAT A1048 Find Coins (25分)——二分查找实现
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However,...原创 2020-03-04 12:10:51 · 254 阅读 · 0 评论 -
PAT A1044 Shopping in Mars (25分)
Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can be cut at any position ...原创 2020-03-03 21:41:54 · 197 阅读 · 0 评论 -
PAT A1085 Perfect Sequence (25分)——二分查找实现
Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the maximum and minimum numbers in the sequence, respecti...原创 2020-02-29 11:04:04 · 295 阅读 · 0 评论 -
PAT A1083 List Grades (25分)
Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...原创 2020-02-12 16:23:05 · 207 阅读 · 0 评论 -
PAT A1075 PAT Judge (25分)
The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input file cont...原创 2020-02-11 12:32:06 · 274 阅读 · 0 评论 -
PAT A1055 The World's Richest (25分)
Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this job, but concentrate only on the peopl...原创 2020-02-10 17:54:38 · 208 阅读 · 0 评论 -
PAT A1062 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 being outstanding in both talent and virt...原创 2020-01-20 22:08:02 · 180 阅读 · 0 评论 -
PAT A1082 Read Number in Chinese (25分)
Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai ...原创 2020-01-19 21:24:04 · 193 阅读 · 0 评论 -
PAT A1077 Kuchiguse (20分)
The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called ...原创 2020-01-09 20:26:44 · 540 阅读 · 0 评论 -
PAT A1061 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 those strange strings...原创 2019-10-18 23:28:02 · 202 阅读 · 0 评论 -
PAT A1058 A+B in Hogwarts (20 分)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sic...原创 2019-10-18 22:43:22 · 198 阅读 · 2 评论 -
PAT A1001 A+B Format (20 分)
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 are less than four digits).Input Specification:Each input fil...原创 2019-09-25 22:56:22 · 135 阅读 · 0 评论