随笔分类 -  pat

problems from pat
摘要:It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if 阅读全文
posted @ 2018-06-14 11:51 赖兴宇 阅读(342) 评论(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-06-14 10:12 赖兴宇 阅读(163) 评论(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 @ 2018-06-14 00:58 赖兴宇 阅读(362) 评论(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-06-13 23:07 赖兴宇 阅读(207) 评论(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 @ 2018-06-13 21:17 赖兴宇 阅读(628) 评论(0) 推荐(0)
摘要:Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all 阅读全文
posted @ 2018-06-13 19:22 赖兴宇 阅读(233) 评论(0) 推荐(0)
摘要:Given two strings S~1~ and S~2~, S = S~1~ - S~2~ is defined to be the remaining string after taking all the characters in S~2~ from S~1~. Your task is 阅读全文
posted @ 2018-06-13 17:09 赖兴宇 阅读(103) 评论(0) 推荐(0)
摘要:Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "ins 阅读全文
posted @ 2018-06-13 16:59 赖兴宇 阅读(173) 评论(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 @ 2018-06-13 16:53 赖兴宇 阅读(127) 评论(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 @ 2018-06-13 16:25 赖兴宇 阅读(171) 评论(0) 推荐(0)
摘要:Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat 阅读全文
posted @ 2018-06-13 16:05 赖兴宇 阅读(130) 评论(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 @ 2018-06-13 15:52 赖兴宇 阅读(169) 评论(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 @ 2018-06-13 15:41 赖兴宇 阅读(196) 评论(0) 推荐(0)
摘要:Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operat 阅读全文
posted @ 2018-06-13 14:23 赖兴宇 阅读(154) 评论(0) 推荐(0)
摘要:Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each input file contains o 阅读全文
posted @ 2018-06-12 22:42 赖兴宇 阅读(218) 评论(0) 推荐(0)
摘要:Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M <= m * p where M and m are 阅读全文
posted @ 2018-06-12 22:20 赖兴宇 阅读(168) 评论(0) 推荐(0)
摘要:Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each 阅读全文
posted @ 2018-06-12 21:16 赖兴宇 阅读(166) 评论(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 @ 2018-06-12 20:03 赖兴宇 阅读(158) 评论(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 @ 2018-06-12 19:27 赖兴宇 阅读(144) 评论(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 @ 2018-06-12 17:50 赖兴宇 阅读(190) 评论(0) 推荐(0)