随笔分类 -  普通题

摘要:Problem DescriptionGiven a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is A[1].Now your job is to calculate the max sum of a Max-K-sub-sequence. Max-K-sub-sequence means a continuous non-empty sub-sequence which 阅读全文
posted @ 2013-11-30 10:01 persistent codeants 阅读(238) 评论(0) 推荐(0)
摘要:DescriptionAlice is exploring the wonderland, suddenly she fell into a hole, when she woke up, she found there areb - a+ 1 treasures labledafrombin front of her.Alice was very excited but unfortunately not all of the treasures are real, some are fake.Now we know a treasure lablednis real if and only 阅读全文
posted @ 2013-11-24 16:07 persistent codeants 阅读(227) 评论(0) 推荐(0)
摘要:DescriptionThere arencities(1,2, ... ,n) forming a line on the wonderland. cityiand cityi+1are adjacent and their distance is 1. Each city has many gold coins. Now, Alice and her friend Bob make a team to go treasure hunting. They starts at cityp, and they want to get as many gold coins as possible 阅读全文
posted @ 2013-11-23 11:04 persistent codeants 阅读(262) 评论(0) 推荐(0)
摘要:Problem DescriptionYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how the strings are generated and inserted into the original message. 阅读全文
posted @ 2013-10-29 22:19 persistent codeants 阅读(301) 评论(0) 推荐(0)
摘要:Problem DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order. For the input sequence9 1 0 5 4 ,Ultra-QuickSort produces the 阅读全文
posted @ 2013-10-29 11:39 persistent codeants 阅读(190) 评论(0) 推荐(0)
摘要:Problem DescriptionYou may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read information about a collection of snowflakes, and search for a pair that may be identical. Each snowflake has six arms. For each sn 阅读全文
posted @ 2013-10-28 17:57 persistent codeants 阅读(269) 评论(0) 推荐(0)
摘要:Problem DescriptionConsider equations having the following form:a1x13+ a2x23+ a3x33+ a4x43+ a5x53=0The coefficients are given integers from the interval [-50,50].It is consider a solution a system (x1, x2, x3, x4, x5) that verifies the equation, xi∈[-50,50], xi != 0, any i∈{1,2,3,4,5}.Determine how 阅读全文
posted @ 2013-10-26 15:07 persistent codeants 阅读(267) 评论(0) 推荐(0)
摘要:Problem DescriptionA square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its centre by 90 degrees gives the same polygon. It is not the only polygon with the latter property, however, as a regular octagon a 阅读全文
posted @ 2013-10-26 13:03 persistent codeants 阅读(246) 评论(0) 推荐(0)
摘要:Problem DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of4n+1numbers. Here, we do only a bit of that.AnH-number is a positive number which is one more than a multiple of four: 1, 5, 9, 13, 17, 21,... are theH-numbers. For this 阅读全文
posted @ 2013-10-26 11:06 persistent codeants 阅读(165) 评论(0) 推荐(0)
摘要:Problem DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of positive integer numbers ranging from 1 to k, written one after another.For example, the first 80 d 阅读全文
posted @ 2013-10-23 18:53 persistent codeants 阅读(203) 评论(0) 推荐(0)
摘要:Problem DescriptionA common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips,S1andS2, each stack containingCchips. Each stack may contain chips of several different colors.The actual shuffle operation is 阅读全文
posted @ 2013-10-16 19:16 persistent codeants 阅读(360) 评论(0) 推荐(0)
摘要:Problem DescriptionIn a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, all warehouses are rectangular, and all robots occupy a circular floor space with a diameter of 阅读全文
posted @ 2013-10-04 19:08 persistent codeants 阅读(224) 评论(0) 推荐(0)
摘要:Problem DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can't be planted. Canny FJ knows that t 阅读全文
posted @ 2013-09-07 22:09 persistent codeants 阅读(266) 评论(0) 推荐(0)
摘要:DescriptionYou are to write a program that has to generate all possible words from a given set of letters. Example: Given the word "abc", your program should - by exploring all different combination of the three letters - output the words "abc", "acb", "bac", 阅读全文
posted @ 2013-09-02 19:09 persistent codeants 阅读(217) 评论(0) 推荐(0)
摘要:DescriptionThe relative frequency of characters in natural language texts is very important for cryptography. However, the statistics vary for different languages. Here are the top 9 characters sorted by their relative frequencies for several common languages:English: ETAOINSHR German: ENIRSATUD Fr. 阅读全文
posted @ 2013-08-14 09:59 persistent codeants 阅读(298) 评论(0) 推荐(0)