随笔分类 -  PAT 甲级

摘要: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 阅读全文
posted @ 2018-08-02 17:05 王清河 阅读(170) 评论(0) 推荐(0) 编辑
摘要: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 elev 阅读全文
posted @ 2018-08-01 12:33 王清河 阅读(112) 评论(0) 推荐(0) 编辑
摘要: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, a 阅读全文
posted @ 2018-07-29 12:03 王清河 阅读(142) 评论(0) 推荐(0) 编辑
摘要: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 t 阅读全文
posted @ 2018-07-29 10:49 王清河 阅读(145) 评论(0) 推荐(0) 编辑
摘要: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 sym 阅读全文
posted @ 2018-07-28 20:59 王清河 阅读(111) 评论(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 @ 2018-07-28 20:47 王清河 阅读(118) 评论(0) 推荐(0) 编辑
摘要:Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off th 阅读全文
posted @ 2018-07-25 11:03 王清河 阅读(96) 评论(0) 推荐(0) 编辑
摘要:Given a sequence of K integers { N~1~, N~2~, ..., N~K~ }. A continuous subsequence is defined to be { N~i~, N~i+1~, ..., N~j~ } where 1 <= i <= j <= K 阅读全文
posted @ 2018-07-24 11:04 王清河 阅读(94) 评论(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 @ 2018-07-23 11:01 王清河 阅读(137) 评论(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 @ 2018-07-22 15:49 王清河 阅读(467) 评论(0) 推荐(0) 编辑
摘要:According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. At each iteration, ins 阅读全文
posted @ 2018-07-15 18:06 王清河 阅读(125) 评论(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 "soci 阅读全文
posted @ 2018-07-15 11:23 王清河 阅读(138) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-07-14 21:47 王清河 阅读(240) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-07-13 18:21 王清河 阅读(148) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-07-12 20:01 王清河 阅读(218) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-07-12 17:31 王清河 阅读(133) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty tree with root R, and with weight W~i~ assigned to each tree node T~i~. The weight of a path from R to L is defined to be the sum of 阅读全文
posted @ 2018-07-12 11:08 王清河 阅读(137) 评论(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 @ 2018-07-11 16:53 王清河 阅读(93) 评论(0) 推荐(0) 编辑
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer 阅读全文
posted @ 2018-07-11 13:39 王清河 阅读(101) 评论(0) 推荐(0) 编辑
摘要:A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find t 阅读全文
posted @ 2018-07-11 11:50 王清河 阅读(110) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示