12 2019 档案

摘要: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-12-21 15:13 57one 阅读(322) 评论(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-12-20 09:38 57one 阅读(220) 评论(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-12-20 09:34 57one 阅读(276) 评论(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-12-20 09:31 57one 阅读(238) 评论(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-12-19 16:51 57one 阅读(179) 评论(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-12-19 16:02 57one 阅读(425) 评论(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-12-19 15:19 57one 阅读(192) 评论(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-12-18 20:39 57one 阅读(188) 评论(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-12-18 19:18 57one 阅读(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 @ 2019-12-18 17:51 57one 阅读(176) 评论(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-12-17 17:19 57one 阅读(124) 评论(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-12-17 16:38 57one 阅读(177) 评论(0) 推荐(0) 编辑
摘要:一般判断素数的方法是从2开始到sqrt(n)判断是否有数为n的因子 若有则说明该数是非素数 1 bool Is_Prime = true; 2 for (int i = 2; i * i < N; i++) 3 { 4 if (N % i == 0) 5 Is_Prime = false; 6 } 阅读全文
posted @ 2019-12-17 15:55 57one 阅读(148) 评论(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-12-17 15:33 57one 阅读(161) 评论(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-12-17 14:27 57one 阅读(172) 评论(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-12-17 13:44 57one 阅读(97) 评论(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-12-16 20:33 57one 阅读(182) 评论(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-12-16 19:01 57one 阅读(122) 评论(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-12-16 18:50 57one 阅读(84) 评论(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-12-15 20:34 57one 阅读(176) 评论(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-12-15 17:30 57one 阅读(139) 评论(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-12-15 16:21 57one 阅读(77) 评论(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 @ 2019-12-15 16:10 57one 阅读(166) 评论(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-12-15 15:34 57one 阅读(133) 评论(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 @ 2019-12-13 21:21 57one 阅读(154) 评论(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 @ 2019-12-13 20:19 57one 阅读(251) 评论(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 @ 2019-12-13 15:47 57one 阅读(149) 评论(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 @ 2019-12-12 20:44 57one 阅读(288) 评论(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-12-12 19:00 57one 阅读(176) 评论(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 @ 2019-12-11 15:37 57one 阅读(203) 评论(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 @ 2019-12-11 15:01 57one 阅读(191) 评论(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 @ 2019-12-10 21:15 57one 阅读(150) 评论(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 @ 2019-12-10 18:04 57one 阅读(256) 评论(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 @ 2019-12-10 17:25 57one 阅读(183) 评论(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 @ 2019-12-10 15:03 57one 阅读(210) 评论(0) 推荐(0) 编辑
摘要:1036 Boys vs Girls (25分) This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all 阅读全文
posted @ 2019-12-09 21:47 57one 阅读(202) 评论(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 @ 2019-12-09 21:32 57one 阅读(232) 评论(0) 推荐(0) 编辑
摘要:One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is re 阅读全文
posted @ 2019-12-09 21:10 57one 阅读(158) 评论(0) 推荐(0) 编辑
摘要:With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas s 阅读全文
posted @ 2019-12-08 19:28 57one 阅读(305) 评论(0) 推荐(0) 编辑
摘要:To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same s 阅读全文
posted @ 2019-12-08 16:48 57one 阅读(217) 评论(0) 推荐(0) 编辑
摘要:Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l r 阅读全文
posted @ 2019-12-08 15:56 57one 阅读(246) 评论(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 @ 2019-12-08 15:23 57one 阅读(223) 评论(0) 推荐(0) 编辑
摘要:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1 阅读全文
posted @ 2019-12-08 14:56 57one 阅读(350) 评论(0) 推荐(0) 编辑
摘要:A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open 阅读全文
posted @ 2019-12-08 10:39 57one 阅读(266) 评论(0) 推荐(0) 编辑
摘要:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test 阅读全文
posted @ 2019-12-01 23:10 57one 阅读(112) 评论(0) 推荐(0) 编辑
摘要:People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, wher 阅读全文
posted @ 2019-12-01 21:37 57one 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run sim 阅读全文
posted @ 2019-12-01 20:52 57one 阅读(97) 评论(0) 推荐(0) 编辑
摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number 阅读全文
posted @ 2019-12-01 18:21 57one 阅读(144) 评论(0) 推荐(0) 编辑

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