PAT甲级
文章平均质量分 70
辞穷
如果你真心想做某事,全世界都会帮你完成。
展开
-
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原创 2017-10-25 02:00:38 · 348 阅读 · 0 评论 -
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 ma原创 2017-10-27 17:52:25 · 342 阅读 · 0 评论 -
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原创 2017-10-20 04:21:28 · 223 阅读 · 0 评论 -
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原创 2017-10-20 03:33:26 · 236 阅读 · 0 评论 -
1096. Consecutive Factors (20)
题目:Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7, where 5, 6, and 7 are the three consecutive numbers. Now give原创 2017-10-27 15:38:44 · 303 阅读 · 0 评论 -
1055. 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 peo原创 2017-09-02 17:37:46 · 219 阅读 · 0 评论 -
1051. Pop Sequence (25)
题目:Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of t原创 2017-09-26 11:37:29 · 231 阅读 · 0 评论 -
1036. Boys vs Girls (25)
题目:This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains on原创 2017-08-24 15:51:00 · 1902 阅读 · 0 评论 -
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, y原创 2017-08-24 11:25:05 · 292 阅读 · 0 评论 -
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.原创 2017-08-24 10:28:11 · 255 阅读 · 0 评论 -
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.原创 2017-10-28 02:05:43 · 265 阅读 · 0 评论 -
1007. Maximum Subsequence Sum (25)
题目:Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the continuous subsequence which ha原创 2017-10-23 14:45:03 · 203 阅读 · 0 评论 -
1125. Chain the Ropes (25)
题目:Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting ch原创 2017-10-25 01:29:49 · 313 阅读 · 0 评论 -
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原创 2017-10-25 01:12:26 · 342 阅读 · 0 评论 -
1132. Cut Integer (20)
题目:Cutting an integer means to cut a K digits long integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesti原创 2017-10-24 21:02:31 · 263 阅读 · 0 评论 -
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原创 2017-10-24 20:13:33 · 284 阅读 · 0 评论 -
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 thei原创 2017-10-24 19:39:20 · 243 阅读 · 0 评论 -
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原创 2017-10-24 19:21:05 · 243 阅读 · 0 评论 -
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 intege原创 2017-10-24 17:14:20 · 253 阅读 · 0 评论 -
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原创 2017-10-24 15:21:40 · 258 阅读 · 0 评论 -
1040. Longest Symmetric String (25)
题目: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-string is “s PAT&TAP s”, hence you mu原创 2017-10-23 15:45:47 · 262 阅读 · 0 评论 -
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 info原创 2017-08-23 16:27:27 · 264 阅读 · 0 评论 -
1002. A+B for Polynomials (25)
题目:This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a pol原创 2017-08-23 15:33:44 · 307 阅读 · 0 评论 -
1048. Find Coins (25)-PAT甲级
题目: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. Howeve原创 2017-04-17 14:54:56 · 246 阅读 · 0 评论 -
1050. String Subtraction (20)-PAT甲级
题目:Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1 - S2 for any given strings. However,原创 2017-04-17 14:10:09 · 279 阅读 · 0 评论 -
1083. List Grades (25)-PAT甲级
题目: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 grade原创 2017-04-17 06:25:21 · 436 阅读 · 0 评论 -
1028. List Sorting (25)-PAT甲级
题目:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Each input file contains one test case. For each case, the first line contains two integers N (原创 2017-04-17 03:51:28 · 288 阅读 · 0 评论 -
1062. Talent and Virtue (25)-PAT甲级
题目:(等同PAT乙级1015题)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原创 2017-04-16 18:48:29 · 286 阅读 · 0 评论 -
1040. 有几个PAT(25)-PAT乙级/A1093
题目: 字符串APPAPT中包含了两个单词“PAT”,其中第一个PAT是第2位(P),第4位(A),第6位(T);第二个PAT是第3位(P),第4位(A),第6位(T)。 现给定字符串,问一共可以形成多少个PAT? 输入格式: 输入只有一行,包含一个字符串,长度不超过105,只包含P、A、T三种字母。 输出格式: 在一行中输出给定字符串中包含多少个PAT。由于原创 2017-03-28 09:05:52 · 637 阅读 · 0 评论 -
1001. A+B Format-PAT甲级
题目: 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 Each input fil原创 2017-03-08 11:02:36 · 331 阅读 · 0 评论 -
1058. A+B in Hogwarts (20)-PAT甲级
题目: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 S原创 2017-04-14 10:25:48 · 234 阅读 · 0 评论 -
1065. A+B and C (64bit) (20)-PAT甲级
题目:Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Input Specification: The first line of the input gives the positive number of test cases, T (<=10). Then原创 2017-04-14 02:25:11 · 452 阅读 · 0 评论 -
1070. Mooncake (25)-PAT甲级
题目:同B1020: http://blog.csdn.net/zzlcsdn2017/article/details/66819465 Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be原创 2017-04-17 15:23:01 · 342 阅读 · 0 评论 -
1081. Rational Sum (20)-PAT甲级
题目: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 positiv原创 2017-04-22 19:26:13 · 568 阅读 · 0 评论 -
1046. Shortest Distance (20)-PAT甲级
题目:The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits. Input Specification: Each input file co原创 2017-04-14 01:45:33 · 316 阅读 · 0 评论 -
1025. PAT Ranking (25)-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 places, and the ranklists原创 2017-04-15 00:42:24 · 369 阅读 · 0 评论 -
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 calle原创 2017-08-25 09:39:21 · 213 阅读 · 0 评论 -
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. Each原创 2017-08-24 22:20:35 · 242 阅读 · 0 评论 -
1027. Colors in Mars (20)
题目: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 Red, the middle 2 d原创 2017-08-24 17:59:16 · 294 阅读 · 0 评论 -
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 numbe原创 2017-08-24 17:33:03 · 257 阅读 · 0 评论