PAT
PAT做题笔记
dcdkDuck
这个作者很懒,什么都没留下…
展开
-
PAT A1049-Counting Ones
PAT A1049-Counting Ones题目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 bei...原创 2020-02-25 20:42:38 · 251 阅读 · 0 评论 -
PAT A1045-Favorite Color Stripe
#PAT A1045-Favorite Color Stripe题目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 p...原创 2020-02-22 20:16:49 · 123 阅读 · 0 评论 -
PAT 1040-Longest Symmetric String
PAT A1040-Longest Symmetric String题目Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub...原创 2020-02-20 20:12:38 · 79 阅读 · 0 评论 -
PAT A1033-To Fill or Not to Fill
PAT A1033-To Fill or Not to Fill题目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...原创 2020-02-16 19:08:30 · 97 阅读 · 0 评论 -
PAT A1031-Hello World for U
#PAT A1031-Hello World for U题目Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat is...原创 2020-02-16 10:32:32 · 91 阅读 · 0 评论 -
PAT A1026-Table Tennis
PAT A1026-Table Tennis题目A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they w...原创 2020-02-15 20:40:05 · 156 阅读 · 0 评论 -
PAT 1016-Phone Bills
PAT 1016-Phone Bills题目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...原创 2020-02-12 16:58:54 · 141 阅读 · 0 评论 -
PAT A1014-Waiting in Line
PAT A1014-Waiting in Line题目Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to...原创 2020-02-11 02:46:22 · 85 阅读 · 0 评论 -
PAT A1013-Battle Over Cities
PAT A1013-Battle Over Cities题目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...原创 2020-02-10 18:35:16 · 88 阅读 · 0 评论 -
PAT A1009-Product of Polynomials
PAT A1009-Product of Polynomials题目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, ...原创 2020-02-10 13:12:45 · 99 阅读 · 0 评论 -
PAT A1007-Maximum Subsequence Sum
PAT A1007-Maximum Subsequence Sum题目Given a sequence of K integers { N1, N2, …, 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 t...原创 2020-02-09 19:55:04 · 152 阅读 · 0 评论 -
PAT A1004-Counting Leaves
PAT A1004-Counting Leaves题目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 ...原创 2020-02-09 16:57:25 · 167 阅读 · 0 评论 -
PAT A1017-Queueing at Bank
PAT A1017-Queueing at Bank题目Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wai...原创 2020-02-09 15:29:43 · 173 阅读 · 0 评论 -
PAT A1030-Travel Plan(Dijkstra)
PAT A1030-Travel Plan(Dijkstra)题目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 tra...原创 2020-02-07 20:44:30 · 131 阅读 · 0 评论 -
PAT-A1021 Deepest Root
PAT-A1021 Deepest Root题目A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a ...原创 2020-02-06 16:53:10 · 141 阅读 · 0 评论 -
PAT A1032-Sharing(链表)
PAT A1032-Sharing(链表)题目To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the ...原创 2020-02-03 17:19:12 · 140 阅读 · 0 评论 -
PAT A1093-Count PAT's
PAT A1093-Count PAT’s题目The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and ...原创 2020-01-31 09:54:04 · 178 阅读 · 0 评论 -
PAT A1010-Radix(二分法)
PAT A1010-Radix(二分法)题干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 an...原创 2020-01-30 21:19:03 · 165 阅读 · 0 评论