11 2021 档案
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Input Specification: The first line of the input gives the p
阅读全文
摘要:Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the tw
阅读全文
摘要: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
阅读全文
摘要:Sherlock Holmes received a note with some strange strings: “Let’s date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm”. It took him only a min
阅读全文
摘要:Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-
阅读全文
摘要:The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s
阅读全文
摘要: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.123*105 with
阅读全文
摘要: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 (
阅读全文
摘要:Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional
阅读全文
摘要:Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1k1 * p2k2 *…*pm^km. Input Specific
阅读全文
摘要: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 S
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to c
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contain
阅读全文
摘要:下载版本 建议onenote2016版,可以装好用的插件~ onenote有两个版本: uwp(Universal Windows Platform,即Windows通用应用平台) 2016版本 两者页面区别: 整体页面外观(UWP版) 整体页面外观(2016版) 另外,2016版本的功能更多,20
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, “helloworld” can be printed as: h ! e d
阅读全文
摘要:Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the
阅读全文
摘要:Description Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are su
阅读全文
摘要:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Each input file contains one test case. For each
阅读全文
摘要: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
阅读全文
摘要:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run sim
阅读全文
摘要: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
阅读全文
摘要:A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c
阅读全文
摘要:A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re
阅读全文
摘要:To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mat
阅读全文
摘要:With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing ba
阅读全文
摘要:This time, you are supposed to find A*B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu
阅读全文
摘要:The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elev
阅读全文
摘要:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door
阅读全文
摘要: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
阅读全文
摘要:Description This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test case. Each case occupie
阅读全文
摘要:Description Calculate a + b and output the sum in standard format — that is, the digits must be separated into groups of three by commas (unless there
阅读全文
摘要:Description 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,
阅读全文
摘要:Description A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an
阅读全文
摘要:2021-11-02 11:16:27 星期二 Description To store English words, one method is to use linked lists and store a word letter by letter. To save some space, w
阅读全文
摘要:Description 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
阅读全文
摘要:1056 Description 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
阅读全文
摘要:1051 题目大意: 有个容量限制为m的栈,分别把1,2,3,...,n入栈,给出一个系列出栈顺序,问这些出栈顺序是否可能~ 柳神分析: 按照要求进行模拟。先把输入的序列接收进数组v。然后按顺序1~n把数字进栈,每进入一个数字,判断有没有超过最大范围,超过了就break。如果没超过,设current
阅读全文

浙公网安备 33010602011771号