POJ 1182 - 食物链

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,

UVA 10583 - Ubiquitous Religions

Ubiquitous Religions There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university believe in. You know that there are n students in your university (0 Input The input consists of a number of cases. Each case starts with a line specifying the integers n and m.

UVA 10059 - Maximum Product

Given a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value of the maximum positive product involving consecutive terms of S. If you cannot find a positive sequence, you should consider 0 as the value of the maximum product. Input Each test case starts with 1 ≤ N ≤ 18, the number of elements in a sequence. Each element Si

UVA 10082 - WERTYU

UVA 10082 - WERTYU A common typing error is to place the hands on the keyboard one row to the right of the correct position. So ‘Q’ is typed as ‘W’ and ‘J’ is typed as ‘K’ and so on. You are to decode a message typed in this manner. Input Input consists of several lines of text. Each line may contain

最大乘积问题

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 /*给定一个序列 序列内部数字自由组合 求最大乘积*/