Problem EThe Other Two TreesInput: standard inputOutput: standard outputTime Limit: 2 seconds You have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four
Problem CA mid-summer night’s dreamInput:standard inputOutput:standard output This is year 2200AD. Science has progressed a lot in two hundred years. Two hundred years is mentioned here because this problem is being sent back to 2000AD with the help
Steps One steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal to, or by one smaller than the length of the previous step.What is the minimum number of steps in order to
Getting in Line Computer networking requires that the computers in the network be linked. This problem considers a ``linear" network in which the computers are chained together so that each is connected to exactly two others except for the two
Problem F: Factoring Large NumbersOne of the central ideas behind much cryptography is that factoring large numbers is computationally intensive. In this context one might use a 100 digit number that was a product of two 50 digit prime numbers. Even
Simple calculations The ProblemThere is a sequence of n+2 elements a0, a1,…, an+1 (n <= 3000; -1000 <= ai 1000). It is known thatai = (ai–1 + ai+1)/2 – ci for each i=1, 2, ..., n. You are given a0, an+1, c1, ... , cn. Write a program which
Unix ls The computer company you work for is introducing a brand new computer line and is developing a new Unix-like operating system to be introduced along with the new computer. Your assignment is to write the formatter for thels function. Your
Cube painting We have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors. The cube's faces are numbered as in Figure 1.Figure 1. Since a cube has 6 faces,
Everybody sit down in a circle. Ok. Listen to me carefully. ``Woooooo, you scwewy wabbit!'' Now, could someone tell me how many words I just said? Input and OutputInput to your program will consist of a series of lines, each line containing
The Land of JusticeInput: standard inputOutput: standard outputTime Limit: 4 secondsIn the Land of Justice the selling price of everything is fixed all over the country. Nobody can buy a thing and sell it in double price. But, that created problems
The ? 1 ? 2 ? ... ? n = k problem The problemGiven the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a given k? 1 ? 2 ? ... ? n = k For example: to obtain k = 12 , the expression to be used will be:- 1 +
Uniform GeneratorComputer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the formwhere `` " is the modulus operator.Such a function will generate pseudo-random numbers (seed) between 0
文章目錄 Sample InputOutput for Sample Input Problem B: Factstone BenchmarkAmtel has announced that it will release a 128-bit computer chip by 2010, a 256-bit computer by 2020, and so on, continuing its strategy of doubling
Pseudo-Random NumbersComputers normally cannot generate really random numbers, but frequently are used to generate sequences of pseudo-random numbers. These are generated by some algorithm, but appear for all practical purposes to be really random.
A polynomial of degree n can be expressed asIf k is any integer then we can write:Here q(x) is called the quotient polynomial ofp(x) of degree (n-1) and r is any integer which is called the remainder.For example, if p(x) = x3 - 7x2+ 15x - 8 andk = 3
Inscribed Circles and Isosceles Triangles Given two real numbers B the width of the base of an isosceles triangle in inches H the altitude of the same isosceles triangle in inchesCompute to six significant decimal places C the sum of the
Skew Binary When a number is expressed in decimal, the k-th digit represents a multiple of 10k. (Digits are numbered from right to left, where the least significant digit is number 0.) For example, When a number is expressed in binary, the k-th
Problem B: Myacm TrianglesSource file:triangle.{c, cpp, java, pas}Input file:triangle.inOutput file:triangle.outThere has been considerable archeological work on the ancient Myacm culture. Many artifacts have been found in what have been called
In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to bottom, your program will display them from top to bottom and right to
Ananagrams Most crossword puzzle fans are used to anagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute, no matter how you rearrange their