05 2020 档案

摘要: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 @ 2020-05-12 15:47 Veritas_des_Liberty 阅读(208) 评论(0) 推荐(0) 编辑
摘要:This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Inp 阅读全文 »
posted @ 2020-05-12 15:13 Veritas_des_Liberty 阅读(234) 评论(0) 推荐(0) 编辑
摘要:The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a produc 阅读全文 »
posted @ 2020-05-12 14:59 Veritas_des_Liberty 阅读(156) 评论(0) 推荐(0) 编辑
摘要:Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we c 阅读全文 »
posted @ 2020-05-12 14:31 Veritas_des_Liberty 阅读(200) 评论(0) 推荐(0) 编辑
摘要:Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the 阅读全文 »
posted @ 2020-05-11 23:52 Veritas_des_Liberty 阅读(195) 评论(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 symme 阅读全文 »
posted @ 2020-05-11 23:28 Veritas_des_Liberty 阅读(183) 评论(0) 推荐(0) 编辑
摘要:Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a numbe 阅读全文 »
posted @ 2020-05-11 23:05 Veritas_des_Liberty 阅读(203) 评论(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 @ 2020-05-11 22:58 Veritas_des_Liberty 阅读(166) 评论(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 @ 2020-05-10 23:30 Veritas_des_Liberty 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making 阅读全文 »
posted @ 2020-05-10 22:09 Veritas_des_Liberty 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Given an undirected tree consisting of n vertices numbered from 0 to n-1, which has some apples in their vertices. You spend 1 second to walk over one 阅读全文 »
posted @ 2020-05-10 18:05 Veritas_des_Liberty 阅读(323) 评论(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 @ 2020-05-09 15:43 Veritas_des_Liberty 阅读(241) 评论(0) 推荐(0) 编辑
摘要:The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of e 阅读全文 »
posted @ 2020-05-09 14:33 Veritas_des_Liberty 阅读(211) 评论(0) 推荐(0) 编辑
摘要:Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output t 阅读全文 »
posted @ 2020-05-09 13:37 Veritas_des_Liberty 阅读(182) 评论(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 @ 2020-05-09 13:01 Veritas_des_Liberty 阅读(282) 评论(0) 推荐(0) 编辑
摘要:The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. F 阅读全文 »
posted @ 2020-05-08 22:20 Veritas_des_Liberty 阅读(237) 评论(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 @ 2020-05-08 17:33 Veritas_des_Liberty 阅读(162) 评论(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 @ 2020-05-08 17:23 Veritas_des_Liberty 阅读(158) 评论(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 @ 2020-05-08 13:40 Veritas_des_Liberty 阅读(163) 评论(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 @ 2020-05-07 22:06 Veritas_des_Liberty 阅读(188) 评论(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 @ 2020-05-07 17:58 Veritas_des_Liberty 阅读(139) 评论(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 @ 2020-05-07 17:47 Veritas_des_Liberty 阅读(188) 评论(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 @ 2020-05-07 16:29 Veritas_des_Liberty 阅读(174) 评论(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 @ 2020-05-06 23:19 Veritas_des_Liberty 阅读(205) 评论(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 @ 2020-05-06 21:21 Veritas_des_Liberty 阅读(186) 评论(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 @ 2020-05-06 21:02 Veritas_des_Liberty 阅读(182) 评论(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 @ 2020-05-06 18:06 Veritas_des_Liberty 阅读(232) 评论(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 @ 2020-05-05 17:17 Veritas_des_Liberty 阅读(213) 评论(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 @ 2020-05-05 15:57 Veritas_des_Liberty 阅读(180) 评论(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 @ 2020-05-05 11:31 Veritas_des_Liberty 阅读(189) 评论(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 @ 2020-05-05 11:14 Veritas_des_Liberty 阅读(159) 评论(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 @ 2020-05-04 22:42 Veritas_des_Liberty 阅读(235) 评论(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 @ 2020-05-04 21:41 Veritas_des_Liberty 阅读(226) 评论(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 @ 2020-05-04 17:32 Veritas_des_Liberty 阅读(247) 评论(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 @ 2020-05-04 15:08 Veritas_des_Liberty 阅读(180) 评论(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 @ 2020-05-03 22:07 Veritas_des_Liberty 阅读(176) 评论(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 阅读(236) 评论(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 阅读(201) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers nums and an integer limit, return the size of the longest continuous subarray such that the absolute difference between any 阅读全文 »
posted @ 2020-05-03 18:22 Veritas_des_Liberty 阅读(547) 评论(0) 推荐(0) 编辑
摘要:You are given an m * n matrix, mat, and an integer k, which has its rows sorted in non-decreasing order. You are allowed to choose exactly 1 element f 阅读全文 »
posted @ 2020-05-03 17:28 Veritas_des_Liberty 阅读(233) 评论(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 阅读(190) 评论(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 阅读(191) 评论(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 阅读(215) 评论(0) 推荐(0) 编辑

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