随笔分类 -  PAT

摘要:Given a set of N (>) positive integers, you are supposed to partition them into two disjoint sets A​1​​ and A​2​​ of n​1​​ and n​2​​ numbers, respecti 阅读全文
posted @ 2021-02-28 23:16 XA科研 阅读(72) 评论(0) 推荐(0)
摘要:Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that 阅读全文
posted @ 2021-02-28 22:50 XA科研 阅读(78) 评论(0) 推荐(0)
摘要: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 -- tha 阅读全文
posted @ 2021-02-28 21:56 XA科研 阅读(59) 评论(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 @ 2021-02-28 21:02 XA科研 阅读(52) 评论(0) 推荐(0)
摘要: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 theor 阅读全文
posted @ 2021-02-27 23:39 XA科研 阅读(78) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-02-27 22:28 XA科研 阅读(86) 评论(0) 推荐(0)
摘要: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 s 阅读全文
posted @ 2021-02-27 21:02 XA科研 阅读(73) 评论(0) 推荐(0)
摘要:"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 阅读全文
posted @ 2021-02-27 20:29 XA科研 阅读(177) 评论(0) 推荐(0)
摘要: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 fri 阅读全文
posted @ 2021-02-27 00:41 XA科研 阅读(57) 评论(0) 推荐(0)
摘要:On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on sc 阅读全文
posted @ 2021-02-27 00:22 XA科研 阅读(51) 评论(0) 推荐(0)
摘要:Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of b 阅读全文
posted @ 2021-02-27 00:02 XA科研 阅读(57) 评论(0) 推荐(0)
摘要: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 cou 阅读全文
posted @ 2021-02-26 23:34 XA科研 阅读(59) 评论(0) 推荐(0)
摘要:People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzi 阅读全文
posted @ 2021-02-26 22:04 XA科研 阅读(69) 评论(0) 推荐(0)
摘要:Given two sets of integers, the similarity of the sets is defined to be /, where N​c​​ is the number of distinct common numbers shared by the two sets 阅读全文
posted @ 2021-02-26 20:47 XA科研 阅读(79) 评论(0) 推荐(0)
摘要: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 socia 阅读全文
posted @ 2021-02-25 23:49 XA科研 阅读(66) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-02-25 22:41 XA科研 阅读(75) 评论(0) 推荐(0)
摘要:One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is re 阅读全文
posted @ 2021-02-25 21:29 XA科研 阅读(86) 评论(0) 推荐(0)
摘要:A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with 阅读全文
posted @ 2021-02-25 20:05 XA科研 阅读(84) 评论(0) 推荐(0)
摘要:Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is t 阅读全文
posted @ 2021-02-25 18:46 XA科研 阅读(68) 评论(0) 推荐(0)
摘要:Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gainin 阅读全文
posted @ 2021-02-25 17:11 XA科研 阅读(87) 评论(0) 推荐(0)