![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
文章平均质量分 85
Amos H
这个作者很懒,什么都没留下…
展开
-
[Python](PAT)1030 Travel Plan (30 分)
A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path b...原创 2018-09-14 13:24:56 · 251 阅读 · 0 评论 -
[PYTHON](PAT)1012 THE BEST RANK (25)
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - Eng...原创 2018-08-25 21:57:44 · 297 阅读 · 0 评论 -
[JAVA/C++](PAT)1011 WORLD CUP BETTING (20)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Si...原创 2018-08-25 21:55:19 · 186 阅读 · 0 评论 -
[PYTHON](PAT)1010 RADIX (25)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is “yes”, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive in...原创 2018-08-25 14:06:58 · 346 阅读 · 1 评论 -
[PYTHON](PAT)1009 PRODUCT OF POLYNOMIALS (25)
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 occupies 2 lines, and each line contains the informa...原创 2018-08-25 14:03:54 · 191 阅读 · 0 评论 -
[JAVA](PAT)1008 ELEVATOR (20)
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 sec...原创 2018-08-25 14:01:21 · 170 阅读 · 0 评论 -
[PYTHON](PAT)1007 MAXIMUM SUBSEQUENCE SUM (25)
Given a sequence of K integers { N~1~, N~2~, …, N~K~ }. A continuous subsequence is defined to be { N~i~, N~i+1~, …, N~j~ } where 1 <= i <= j <= K. The Maximum Subsequence is the continuous s...原创 2018-08-25 13:59:21 · 236 阅读 · 0 评论 -
[PYTHON](PAT)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 those strange strings...原创 2018-08-29 17:02:57 · 171 阅读 · 0 评论 -
[Python](PAT)1060 Are They Equal(25 分)
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×105 with simple chopping. Now given the number of signif...原创 2018-08-29 16:07:41 · 330 阅读 · 0 评论 -
[PYTHON](PAT)1028 LIST SORTING(25 分)
Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two...原创 2018-08-29 22:42:04 · 305 阅读 · 0 评论 -
[Python/Java](PAT)1001 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 ...原创 2018-09-11 21:56:43 · 560 阅读 · 1 评论 -
[Python](PAT)1148 Werewolf - Simple Version(20 分)
Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: "Player #2 is a werewolf."; player #2 said...原创 2018-09-09 10:39:42 · 427 阅读 · 0 评论 -
[Python](PAT)1088 Rational Arithmetic (20 分)
For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification:Each input file contains one test c...原创 2018-09-14 13:21:44 · 200 阅读 · 0 评论 -
[Python](PAT)1049 Counting Ones (30 分)
The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1's i...原创 2018-09-13 14:41:26 · 261 阅读 · 0 评论 -
[Python](PAT)1045 Favorite Color Stripe (30 分)
Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts...原创 2018-09-13 13:05:31 · 271 阅读 · 0 评论 -
PAT甲级部分python解题记录
用Python写PAT甲级,答案都在这了。每一道题都有原题、题目大意以及代码实现,大部分的题目都有详细的逻辑分析。欢迎大家一起来讨论!原创 2018-09-18 14:15:10 · 4271 阅读 · 3 评论 -
[Python](PAT)1071 Speech Patterns(25 分)
People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker...原创 2018-09-10 23:33:19 · 335 阅读 · 0 评论 -
[Python](PAT)1033 To Fill or Not to Fill (25 分)
With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different ga...原创 2018-09-12 23:16:37 · 291 阅读 · 0 评论 -
[Python](PAT)1035 Password (20 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L ...原创 2018-09-16 12:36:44 · 199 阅读 · 0 评论 -
[Python](PAT)1149 Dangerous Goods Packaging(25 分)
When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trouble. For example, oxidizing agent (氧化剂)...原创 2018-09-09 12:34:25 · 344 阅读 · 0 评论 -
[JAVA/PYTHON](PAT)1006 SIGN IN AND SIGN OUT (25)
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s, you...原创 2018-08-24 21:25:40 · 222 阅读 · 0 评论 -
[PYTHON/JAVA](PAT)1005 SPELL IT RIGHT (20)
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Eac...原创 2018-08-24 19:33:42 · 109 阅读 · 0 评论 -
[JAVA/C++](PAT)1004 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.InputEach input file contains one test case. Each case starts with a line co...原创 2018-08-24 18:02:31 · 301 阅读 · 0 评论 -
[PYTHON](PAT)1019 GENERAL PALINDROMIC NUMBER (20)
A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...原创 2018-08-26 08:02:18 · 156 阅读 · 0 评论 -
[PYTHON](PAT)1016 PHONE BILLS (25)
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When...原创 2018-08-26 08:00:26 · 228 阅读 · 0 评论 -
[PYTHON](PAT)1015 REVERSIBLE PRIMES (20)
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a pr...原创 2018-08-26 07:59:02 · 234 阅读 · 0 评论 -
[PYTHON/C++](PAT)1013 BATTLE OVER CITIES (25)
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we nee...原创 2018-08-26 07:57:27 · 284 阅读 · 0 评论 -
(PAT)1001 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).InputEach input file contains ...原创 2018-08-07 21:56:00 · 105 阅读 · 0 评论 -
(PAT)1002 A+B for Polynomials
This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polyn...原创 2018-08-06 21:51:29 · 128 阅读 · 0 评论 -
[Python/C++](PAT)1078 Hashing (25)
The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be “H(key) = key %...原创 2018-08-10 09:47:15 · 143 阅读 · 0 评论 -
[Python/C++](PAT)1077 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 ...原创 2018-08-10 09:45:25 · 570 阅读 · 0 评论 -
[Python](PAT)1140 Look-and-say Sequence(20 分)
Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...where D is in [0, 9] except 1. The (n+1)st number is a kind of description of the nth n...原创 2018-08-26 11:23:48 · 220 阅读 · 0 评论 -
[Python](PAT)1142 Maximal Clique(25 分)
A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extended by including one more adj...原创 2018-08-26 12:35:27 · 308 阅读 · 0 评论 -
[Python](PAT)1146 Topological Order(25 分)
点这里,用Python写PAT甲级的答案都有1146 Topological Order(25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed ...原创 2018-08-26 14:08:36 · 218 阅读 · 0 评论 -
[Python](PAT)1021 Deepest Root(25 分)
A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root i...原创 2018-08-28 22:54:23 · 431 阅读 · 0 评论 -
[PYTHON](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 f...原创 2018-08-28 16:06:46 · 130 阅读 · 0 评论 -
[Python](PAT)1102 Invert a Binary Tree(25 分)
Python写PAT甲级,答案都在这了The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so fuck off....原创 2018-08-28 13:29:41 · 190 阅读 · 0 评论 -
[Python](PAT)1025 PAT Ranking(25 分)
Python写PAT甲级,答案都在这儿了Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several place...原创 2018-08-27 23:07:18 · 653 阅读 · 0 评论 -
[Python](PAT)1122 Hamiltonian Cycle(25 分)
Python写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 problem, you are supposed to ...原创 2018-08-27 11:48:31 · 280 阅读 · 0 评论 -
[Python](PAT)1027 Colors in Mars(20 分)
用python写PAT甲级,答案都在这People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for ...原创 2018-08-27 00:02:29 · 215 阅读 · 0 评论