随笔分类 -  PAT

摘要: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 阅读(217) 评论(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 阅读(133) 评论(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 阅读(238) 评论(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 阅读(178) 评论(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 阅读(110) 评论(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 阅读(174) 评论(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 阅读(133) 评论(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 阅读(312) 评论(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 阅读(314) 评论(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 阅读(291) 评论(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 阅读(113) 评论(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 阅读(155) 评论(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 阅读(196) 评论(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 阅读(143) 评论(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 阅读(188) 评论(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-07-31 14:55 自由之翼Az 阅读(309) 评论(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-07-31 13:39 自由之翼Az 阅读(151) 评论(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-07-30 23:14 自由之翼Az 阅读(185) 评论(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-07-30 22:35 自由之翼Az 阅读(189) 评论(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-07-30 22:12 自由之翼Az 阅读(268) 评论(0) 推荐(0)