文章列表
Problem Statement
Given the width and height of a rectangular grid, return the total number of rectangles (NOT counting squares) that can be found on this grid.
For example, width = 3, height = 3 (see diagram below):
__ __ __
|__|__|__|
|__|__|__|
|__|__|__|
In this grid ...
Problem Statement
Your master construction unit can build 1 unit of type 0 in times[0] seconds at a cost of costs[0]. Each unit of type 0, once built, can in turn build 1 unit of type 1 in times[1] seconds at a cost of costs[1]. Type 1 units can build units of type 2, and so forth. ...
Problem Statement
In music, each note has a relative duration. For example, a whole note lasts four times longer than a quarter note. Half notes, eighth notes, and sixteenth notes have one half, one eighth, and one sixteenth the duration of whole notes, respectively.
A musical ...
TCHS-4-250
- 博客分类:
- TopCoder
Problem Statement
You will be running a race on a straight track, and you have devised the following trick to help you win. The weather forecast for the day of the race indicates that there will be a strong wind blowing directly from the finish line to the starting line. You a ...
TCHS-3-1000
- 博客分类:
- TopCoder
Problem Statement
A decomposition of a non-negative integer n is a list of non-negative integers that sum to exactly n. The product of a decomposition is the product of all its members. For example, if n = 4, the following decompositions are possible:
4 = 1+1+1+1, product is 1* ...
Problem Statement
Three kids are playing the following game: A word is written on a sheet of paper, and one after another, the players take turns adding letters to the word. During each turn, a player must add a single letter to either the beginning or the end of the word. If a p ...
Problem Statement
After selling goods all day, a salesman would like to determine the most desirable item in his inventory. You are given a String[] items, each element of which represents a single item that was sold during the day. Return the item that was sold the most numbe ...
Problem Statement
A spell is defined by its incantation, the word spoken when the spell is being cast. If you know the incantation of a spell, you can create counterspells in the following manner. First, you can optionally delete any number of characters from the original incant ...
Problem Statement
The number 666 is considered to be the occult "number of the beast" and is a well used number in all major apocalypse themed blockbuster movies. However the number 666 can't always be used in the script so numbers such as 1666 are used instead. Let us ca ...
TCHS-2-250
- 博客分类:
- TopCoder
Problem Statement
A Fountain of Life is a special fountain that produces the elixir of life at a constant speed of elixir liters per second. A dark mage managed to cast a Curse of Death on the Fountain so in addition to the elixir it now produces a deadly poison at a constant speed ...
Problem Statement
People enjoy mazes, but they also get them dirty. Arrows, graffiti, and chewing gum are just a few of the souvenirs people leave on the walls. You, the maze keeper, are assigned to whiten the maze walls. Each face of the wall requires one liter of paint, but you ...
Problem Statement
In written languages, some symbols may appear more often than others. Expected frequency tables have been defined for many languages. For each symbol in a language, a frequency table will contain its expected percentage in a typical passage written in that langu ...
TCHS-1-250
- 博客分类:
- TopCoder
Problem Statement
A speed radar is installed in a highway zone where the maximum speed limit is maxLimit mph, and the minimum speed limit is minLimit mph. Any reading that is strictly above or below this interval is an infringement.
Periodically, the radar readings are analyzed ...