随笔分类 - 数据结构学习笔记
摘要:Problem DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different regions of Atlantis. Your friend Bill has to know the total area for which
阅读全文
摘要:Problem DescriptionFleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remember, vividly, on the beautiful Zhuhai Campus, 4 years ago, from the moment I saw you smile, as you were walking out of the classroom and turned your head back, with the soft
阅读全文
摘要:Problem DescriptionThe little cat takes over the management of a new park. There is a large circular statue in the center of the park, surrounded by N pots of flowers. Each potted flower will be assigned to an integer number (possibly negative) denoting how attractive it is. See the following graph
阅读全文
摘要:Problem DescriptionYou are given a sequence ofnintegersa1, a2, ... , anin non-decreasing order. In addition to that, you are given several queries consisting of indicesiandj(1 ≤ i ≤ j ≤ n). For each query, determine the most frequent value among the integersai, ... , aj.InputThe input consists of se
阅读全文
摘要:Problem DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers want to know the distribution of
阅读全文
摘要:Problem DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify which gang a criminal belongs to. The present question is, given two criminals; do they
阅读全文
摘要:Problem DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still had schedules going here and there. Now, he had to travel by train to Mianyang, Sichuan Pr
阅读全文
摘要:Problem DescriptionNchildren are sitting in a circle to play a game.The children are numbered from 1 toNin clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. The game starts from theK-th child, who tells all the others the integer on his card and jumps out of the
阅读全文
摘要:Problem DescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tree has N forks which are connected by branches. Kaka numbers the forks by 1 to N and the
阅读全文
摘要:Problem DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of cows from the milking lineup to pl
阅读全文
摘要:Problem DescriptionYou, as a member of a development team for a new spell checking program, are to write a module that will check the correctness of given words using a known dictionary of all correct words in all their forms.If the word is absent in the dictionary then it can be replaced by correct
阅读全文
摘要:Problem DescriptionFarmer John'sNcows (1 ≤N≤ 100,000) share many similarities. In fact, FJ has been able to narrow down the list of features shared by his cows to a list of onlyKdifferent features (1 ≤K≤ 30). For example, cows exhibiting feature #1 might have spots, cows exhibiting feature #2 mi
阅读全文
摘要:Problem DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the stock market. For maximum effect, you have to spread the rumours in the fastest possible
阅读全文
摘要:Problem DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of up to 100,000 dictionary entries, followed by a blank line, followed by a
阅读全文
摘要:Problem DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows and columns numbered from 0 to S-1. Each square contains a base station. The number of active mobi
阅读全文
摘要:Problem DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender. In his experiment, individual bugs and their interactions were easy to identify
阅读全文
摘要:Problem DescriptionSeiji Hayashi had been a professor of the Nisshinkan Samurai School in the domain of Aizu for a long time in the 18th century. In order to reward him for his meritorious career in education, Katanobu Matsudaira, the lord of the domain of Aizu, had decided to grant him a rectangula
阅读全文
摘要:1354. Palindrome. Again PalindromeTime limit: 1.0 second Memory limit: 64 MBAwordis the nonempty sequence of symbolsa1a2…an. Apalindromeis the worda1a2…anthat is read from the left to the right and from the right to the left the same way (a1a2…an=anan−1…a1). IfS1=a1a2…anandS2=b1b2…bm, thenS1S2=a1a2…
阅读全文
摘要:1423. String TaleTime limit: 1.0 second Memory limit: 64 MBBackgroundI want to tell you a story. Not entirely, but only the very beginning, because the ending of this story became a legend of programming—as well as its heroes.When computers were large, when trees were small, when the sun shined brig
阅读全文
摘要:1320. Graph DecompositionTime limit: 0.5 second Memory limit: 64 MBThere is a simple graph with an even number of edges. You are to define if it is possible to present it by the set of pairs of adjacent edges (having a common vertex).Inputcontains a sequence of the numbers pairs. Each pair denotes v
阅读全文

浙公网安备 33010602011771号