随笔分类 -  PAT

摘要:Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the 阅读全文
posted @ 2017-10-27 16:24 gaoren 阅读(174) 评论(0) 推荐(0)
摘要:The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a produc 阅读全文
posted @ 2017-10-27 09:02 gaoren 阅读(312) 评论(0) 推荐(0)
摘要: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. Inp 阅读全文
posted @ 2017-10-26 19:48 gaoren 阅读(315) 评论(0) 推荐(0)
摘要: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 s 阅读全文
posted @ 2017-10-25 09:44 gaoren 阅读(198) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-24 18:59 gaoren 阅读(165) 评论(0) 推荐(0)
摘要:Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a numbe 阅读全文
posted @ 2017-10-23 20:24 gaoren 阅读(166) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-22 10:04 gaoren 阅读(241) 评论(0) 推荐(0)
摘要: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 s 阅读全文
posted @ 2017-10-21 10:17 gaoren 阅读(208) 评论(0) 推荐(0)
摘要: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: That is 阅读全文
posted @ 2017-10-20 08:52 gaoren 阅读(239) 评论(0) 推荐(0)
摘要: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 progra 阅读全文
posted @ 2017-10-19 18:22 gaoren 阅读(214) 评论(0) 推荐(0)
摘要:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, a 阅读全文
posted @ 2017-10-19 16:39 gaoren 阅读(174) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-19 08:53 gaoren 阅读(177) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-18 13:34 gaoren 阅读(309) 评论(0) 推荐(0)
摘要:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run sim 阅读全文
posted @ 2017-10-17 10:36 gaoren 阅读(242) 评论(0) 推荐(0)
摘要: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, wher 阅读全文
posted @ 2017-10-16 09:14 gaoren 阅读(221) 评论(0) 推荐(0)
摘要:A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years 阅读全文
posted @ 2017-10-15 12:40 gaoren 阅读(176) 评论(0) 推荐(0)
摘要: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 s 阅读全文
posted @ 2017-10-14 15:37 gaoren 阅读(182) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-14 10:21 gaoren 阅读(173) 评论(0) 推荐(0)
摘要: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 2469135 阅读全文
posted @ 2017-10-13 09:27 gaoren 阅读(501) 评论(0) 推荐(0)
摘要:A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contain 阅读全文
posted @ 2017-10-12 09:47 gaoren 阅读(137) 评论(0) 推荐(0)