08 2019 档案

摘要:The K−P factorization of a positive integer N is to write N as the sum of the P-th power of Kpositive integers. You are supposed to write a program to 阅读全文
posted @ 2019-08-30 18:21 自由之翼Az 阅读(179) 评论(0) 推荐(0) 编辑
摘要:The following is from Max Howell @twitter: Now it's your turn to prove that YOU CAN invert a binary tree! Input Specification: Each input file contain 阅读全文
posted @ 2019-08-16 20:45 自由之翼Az 阅读(180) 评论(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 @ 2019-08-16 20:04 自由之翼Az 阅读(142) 评论(0) 推荐(0) 编辑
摘要:People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, m 阅读全文
posted @ 2019-08-16 14:05 自由之翼Az 阅读(175) 评论(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 @ 2019-08-16 10:39 自由之翼Az 阅读(175) 评论(0) 推荐(0) 编辑
摘要:According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert 阅读全文
posted @ 2019-08-15 11:01 自由之翼Az 阅读(209) 评论(0) 推荐(0) 编辑
摘要:Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va 阅读全文
posted @ 2019-08-15 10:49 自由之翼Az 阅读(185) 评论(0) 推荐(0) 编辑
摘要:Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, a 阅读全文
posted @ 2019-08-15 10:13 自由之翼Az 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the g 阅读全文
posted @ 2019-08-14 14:57 自由之翼Az 阅读(250) 评论(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 @ 2019-08-14 10:21 自由之翼Az 阅读(166) 评论(0) 推荐(0) 编辑
摘要:The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed 阅读全文
posted @ 2019-08-13 23:39 自由之翼Az 阅读(252) 评论(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 @ 2019-08-13 22:28 自由之翼Az 阅读(162) 评论(0) 推荐(0) 编辑
摘要:One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions 阅读全文
posted @ 2019-08-13 22:08 自由之翼Az 阅读(150) 评论(0) 推荐(0) 编辑
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer 阅读全文
posted @ 2019-08-13 11:55 自由之翼Az 阅读(160) 评论(0) 推荐(0) 编辑
摘要:According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert 阅读全文
posted @ 2019-08-13 10:59 自由之翼Az 阅读(214) 评论(0) 推荐(0) 编辑
摘要:For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient. Input Sp 阅读全文
posted @ 2019-08-12 22:08 自由之翼Az 阅读(223) 评论(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 @ 2019-08-12 20:59 自由之翼Az 阅读(187) 评论(0) 推荐(0) 编辑
摘要:An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the 阅读全文
posted @ 2019-08-12 09:32 自由之翼Az 阅读(158) 评论(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 the max 阅读全文
posted @ 2019-08-11 23:28 自由之翼Az 阅读(328) 评论(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 @ 2019-08-11 22:35 自由之翼Az 阅读(137) 评论(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 @ 2019-08-11 20:45 自由之翼Az 阅读(181) 评论(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 @ 2019-08-11 20:25 自由之翼Az 阅读(300) 评论(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 @ 2019-08-09 13:28 自由之翼Az 阅读(179) 评论(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 @ 2019-08-09 12:58 自由之翼Az 阅读(166) 评论(0) 推荐(0) 编辑
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer 阅读全文
posted @ 2019-08-09 10:18 自由之翼Az 阅读(180) 评论(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 @ 2019-08-08 23:17 自由之翼Az 阅读(255) 评论(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 @ 2019-08-08 14:19 自由之翼Az 阅读(190) 评论(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 @ 2019-08-08 11:07 自由之翼Az 阅读(212) 评论(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 @ 2019-08-07 14:54 自由之翼Az 阅读(207) 评论(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 @ 2019-08-07 11:39 自由之翼Az 阅读(257) 评论(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 @ 2019-08-07 10:06 自由之翼Az 阅读(222) 评论(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 @ 2019-08-06 23:10 自由之翼Az 阅读(483) 评论(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 @ 2019-08-06 20:50 自由之翼Az 阅读(228) 评论(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 @ 2019-08-06 10:38 自由之翼Az 阅读(188) 评论(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 @ 2019-08-06 09:24 自由之翼Az 阅读(216) 评论(0) 推荐(0) 编辑
摘要:Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation tha 阅读全文
posted @ 2019-08-05 23:29 自由之翼Az 阅读(198) 评论(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 @ 2019-08-05 22:42 自由之翼Az 阅读(148) 评论(0) 推荐(0) 编辑
摘要: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 @ 2019-08-05 14:47 自由之翼Az 阅读(219) 评论(0) 推荐(0) 编辑
摘要:Given three integers A, B and C in [−], you are supposed to tell whether A+B>C. Input Specification: The first line of the input gives the positive nu 阅读全文
posted @ 2019-08-03 19:21 自由之翼Az 阅读(310) 评论(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 @ 2019-08-03 16:42 自由之翼Az 阅读(211) 评论(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 @ 2019-08-03 15:09 自由之翼Az 阅读(130) 评论(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 @ 2019-08-03 14:45 自由之翼Az 阅读(231) 评论(0) 推荐(0) 编辑
摘要:Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minut 阅读全文
posted @ 2019-08-03 13:09 自由之翼Az 阅读(174) 评论(0) 推荐(0) 编辑
摘要:If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0 with simple c 阅读全文
posted @ 2019-08-03 11:22 自由之翼Az 阅读(105) 评论(0) 推荐(0) 编辑
摘要:Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p​1​​​k​1​​​​×p​2​​​k​2​​​​×⋯×p​m​​​ 阅读全文
posted @ 2019-08-03 10:32 自由之翼Az 阅读(167) 评论(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 @ 2019-08-03 09:04 自由之翼Az 阅读(131) 评论(0) 推荐(0) 编辑
摘要:Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push ( 阅读全文
posted @ 2019-08-02 23:44 自由之翼Az 阅读(307) 评论(0) 推荐(0) 编辑
摘要:Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given 阅读全文
posted @ 2019-08-02 22:29 自由之翼Az 阅读(304) 评论(0) 推荐(0) 编辑
摘要:Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to si 阅读全文
posted @ 2019-08-01 23:15 自由之翼Az 阅读(286) 评论(0) 推荐(0) 编辑
摘要:Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color 阅读全文
posted @ 2019-08-01 22:15 自由之翼Az 阅读(108) 评论(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 阅读全文
posted @ 2019-08-01 21:57 自由之翼Az 阅读(148) 评论(0) 推荐(0) 编辑
摘要:A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key  阅读全文
posted @ 2019-08-01 10:47 自由之翼Az 阅读(189) 评论(0) 推荐(0) 编辑
摘要:Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s 阅读全文
posted @ 2019-08-01 10:06 自由之翼Az 阅读(138) 评论(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 阅读全文
posted @ 2019-08-01 09:19 自由之翼Az 阅读(185) 评论(0) 推荐(0) 编辑

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