随笔分类 -  PAT

摘要:For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decre 阅读全文
posted @ 2020-05-03 22:07 Veritas_des_Liberty 阅读(182) 评论(0) 推荐(0)
摘要:Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional 阅读全文
posted @ 2020-05-03 21:20 Veritas_des_Liberty 阅读(249) 评论(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 @ 2020-05-03 20:49 Veritas_des_Liberty 阅读(208) 评论(0) 推荐(0)
摘要:A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as po 阅读全文
posted @ 2020-05-03 10:32 Veritas_des_Liberty 阅读(197) 评论(0) 推荐(0)
摘要:Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+- 阅读全文
posted @ 2020-05-02 21:52 Veritas_des_Liberty 阅读(198) 评论(0) 推荐(0)
摘要:Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, 阅读全文
posted @ 2020-05-02 21:19 Veritas_des_Liberty 阅读(224) 评论(0) 推荐(0)
摘要:The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist 阅读全文
posted @ 2020-04-30 22:05 Veritas_des_Liberty 阅读(235) 评论(0) 推荐(0)
摘要:Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social n 阅读全文
posted @ 2020-04-30 16:46 Veritas_des_Liberty 阅读(230) 评论(0) 推荐(0)
摘要:The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s 阅读全文
posted @ 2020-04-30 15:14 Veritas_des_Liberty 阅读(188) 评论(0) 推荐(0)
摘要:The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. 阅读全文
posted @ 2020-04-30 14:49 Veritas_des_Liberty 阅读(182) 评论(0) 推荐(0)
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer 阅读全文
posted @ 2020-04-29 22:11 Veritas_des_Liberty 阅读(192) 评论(0) 推荐(0)
摘要:It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if y 阅读全文
posted @ 2020-04-29 21:17 Veritas_des_Liberty 阅读(165) 评论(0) 推荐(0)
摘要:Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Each input file contains one 阅读全文
posted @ 2020-04-29 17:01 Veritas_des_Liberty 阅读(155) 评论(0) 推荐(0)
摘要:Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For exampl 阅读全文
posted @ 2020-04-29 15:28 Veritas_des_Liberty 阅读(222) 评论(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 @ 2020-04-28 22:04 Veritas_des_Liberty 阅读(172) 评论(0) 推荐(0)
摘要:There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then th 阅读全文
posted @ 2020-04-28 17:05 Veritas_des_Liberty 阅读(152) 评论(0) 推荐(0)
摘要:The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a 阅读全文
posted @ 2020-04-28 16:24 Veritas_des_Liberty 阅读(197) 评论(0) 推荐(0)
摘要:The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program t 阅读全文
posted @ 2020-04-28 15:42 Veritas_des_Liberty 阅读(193) 评论(0) 推荐(0)
摘要:Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we 阅读全文
posted @ 2020-04-28 00:36 Veritas_des_Liberty 阅读(241) 评论(0) 推荐(0)
摘要: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 fi 阅读全文
posted @ 2020-04-27 23:22 Veritas_des_Liberty 阅读(165) 评论(0) 推荐(0)