跳至正文

USACO Longest Prefix最长前缀 解题报告

Longest Prefix
IOI’96
The structure of some biological objects is represented by the sequence of their constituents denoted by uppercase letters. Biologists are interested in decomposing a long sequence into shorter ones called primitives.

We say that a sequen[……]

继续阅读

USACO 2.3 Zero Sum 零的算式和 解题报告

Zero Sum

Consider the sequence of digits from 1 through N (where N=9) in increasing order: 1 2 3 … N.

Now insert either a ‘+’ for addition or a ‘-‘ for subtraction or a ‘ ‘ [blank] to run the digits together between each pair of digits (not in front of the f[……]

继续阅读

USACO 2.3 Cow Pedigrees 奶牛家谱 解题报告

Farmer John is considering purchasing a new herd of cows. In this new herd, each mother cow gives birth to two children. The relationships among the cows can easily be represented by one or more binary trees with a total of N (3 <= N < 200) nodes. The tr[……]

继续阅读

USACO 2.3 Money Systems 货币系统 解题报告

Money Systems

The cows have not only created their own government but they have chosen to create their own money system. In their own rebellious way, they are curious about values of coinage. Traditionally, coins come in values like 1, 5, 10, 20 or 25, 50, and[……]

继续阅读

USACO 2.4 Cow Tours 牛的旅行 解题报告

Cow Tours 
Farmer John has a number of pastures on his farm. Cow paths connect some pastures with certain other pastures, forming a field. But, at the present time, you can find at least two pastures that cannot be connected by any sequence of cow paths, thus[......]

继续阅读

USACO 2.4 Overfencing 穿越栅栏 解题报告

USACO 2.4 Overfencing 穿越栅栏 
Overfencing 
Kolstad and Schrijvers 
Farmer John went crazy and created a huge maze of fences out in a field. Happily, he left out two fence segments on the edges, and thus created two exits for the maze. Even more happily, the maze[......]

继续阅读

USACO 2.2 Subset Sums集合 解题报告

USACO 2.2 Subset Sums集合
For many sets of consecutive integers from 1 through N (1 <= N <= 39), one can partition the set into two sets whose sums are identical.
For example, if N=3, one can partition the set {1, 2, 3} in one way so that the sums of both[……]

继续阅读