PAT甲级
JimmyLegend
Write the Code Change the World!
展开
-
1002. A+B for Polynomials (25)
1002. A+B for Polynomials (25)时间限制 400 ms内存限制 65536 kB代码长度限制 16000 B判题程序 Standard 作者 CHEN, YueThis time, you are supposed to find A+B where A and B原创 2017-04-02 19:55:05 · 687 阅读 · 0 评论 -
1001. A+B Format (20)
1001. A+B Format (20)时间限制 400 ms内存限制 65536 kB代码长度限制 16000 B判题程序 Standard 作者 CHEN, YueCalculate a + b and output the sum in standard format -- that i原创 2017-04-02 20:00:07 · 1176 阅读 · 0 评论 -
1004. Counting Leaves (30)
1004. Counting Leaves (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A fami...原创 2018-02-09 18:14:04 · 415 阅读 · 0 评论 -
1005. Spell It Right (20)
1005. Spell It Right (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a...原创 2018-02-09 21:37:06 · 351 阅读 · 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, ...原创 2018-02-10 12:02:48 · 366 阅读 · 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 subse...原创 2018-02-10 17:40:15 · 312 阅读 · 0 评论 -
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 s...原创 2018-02-10 19:16:19 · 255 阅读 · 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 informati...原创 2018-02-10 20:33:03 · 256 阅读 · 0 评论 -
1044. 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 posi...原创 2018-02-25 21:50:19 · 231 阅读 · 0 评论 -
1058. 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 ...原创 2018-02-25 22:07:53 · 219 阅读 · 0 评论 -
1056. Mice and Rice (25)
Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much r...原创 2018-02-26 12:50:42 · 204 阅读 · 0 评论 -
1054. The Dominant Color (20)
Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called th...原创 2018-02-26 13:26:00 · 189 阅读 · 0 评论 -
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 i...原创 2018-02-11 16:10:09 · 351 阅读 · 0 评论 -
1053. 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...原创 2018-02-26 16:27:34 · 208 阅读 · 0 评论 -
1003. Emergency (25)
时间限制 400 ms内存限制 65536 kB代码长度限制 16000 B判题程序 Standard 作者 CHEN, YueAs an emergency rescue team leader of a city, you are given a special map of your country.原创 2018-02-06 11:29:03 · 563 阅读 · 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. ...原创 2018-02-11 21:46:08 · 254 阅读 · 0 评论 -
1059. Prime Factors (25)
Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1 * p2^k2 *…*pm^km.Input Specification:Each input file contains one test case wh...原创 2018-02-26 18:03:45 · 202 阅读 · 0 评论 -
1052. Linked List Sorting (25)
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure. Now ...原创 2018-02-26 21:25:13 · 206 阅读 · 0 评论 -
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 Algebra), and E - E...原创 2018-02-12 21:43:13 · 430 阅读 · 0 评论 -
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...原创 2018-02-12 23:13:36 · 322 阅读 · 0 评论 -
1014. Waiting in Line (30)
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 wait in line are:The space...原创 2018-02-13 18:08:59 · 297 阅读 · 0 评论 -
1057. Stack (30)
Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) and...原创 2018-02-27 14:16:46 · 242 阅读 · 0 评论 -
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 ...原创 2018-02-13 20:37:59 · 309 阅读 · 0 评论 -
1020. Tree Traversals (25)
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the ...原创 2018-02-13 21:47:50 · 272 阅读 · 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 th...原创 2018-03-07 15:03:46 · 212 阅读 · 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 pe...原创 2018-02-27 16:16:04 · 174 阅读 · 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 num...原创 2018-02-14 18:19:22 · 220 阅读 · 0 评论 -
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...原创 2018-03-07 16:13:41 · 252 阅读 · 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...原创 2018-03-07 16:59:12 · 205 阅读 · 0 评论 -
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-02-27 21:04:44 · 197 阅读 · 0 评论 -
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 node's key. The right sub...原创 2018-02-28 09:42:17 · 207 阅读 · 0 评论 -
1066. 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...原创 2018-02-28 10:53:20 · 208 阅读 · 0 评论 -
1018. Public Bike Management (30)
There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other stations in t...原创 2018-02-17 22:44:15 · 350 阅读 · 0 评论 -
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, and Nt is the total number of distinct n...原创 2018-02-28 12:14:22 · 220 阅读 · 0 评论 -
1070. Mooncake (25)
Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. ...原创 2018-02-28 12:58:18 · 185 阅读 · 0 评论 -
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. Whe...原创 2018-02-18 22:57:58 · 529 阅读 · 0 评论 -
1017. Queueing at Bank (25)
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 wait in line behind the yello...原创 2018-02-19 12:09:31 · 1149 阅读 · 2 评论 -
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 ...原创 2018-02-19 13:20:15 · 194 阅读 · 0 评论 -
1031. Hello World for U (20)
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, the characters must be ...原创 2018-02-19 14:20:49 · 250 阅读 · 0 评论 -
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-02-19 15:38:33 · 230 阅读 · 0 评论