第十五篇英语翻译

出处:https://acs.jxnu.edu.cn/problem/NOIOPJCH02069283

Push Botton Lock

 5000ms  1000K

描述:

The Frobozz Magic Lock Company is in the business of manufacturing push button style combination door locks. A push button door lock consists of a number of push buttons B, (1 ≤ B ≤ 11), labeled “1” through “B”. The lock is opened by pressing the correct sequence of button combinations and then turning the doorknob. If the sequence of presses is correct, the door magically opens.

Frobozz Magic Lock公司是一家生产按钮式组合门锁的公司。按钮门锁由多个按钮B组成(1≤ B≤ 11) ,标记为“1”到“B”。按正确的按钮组合顺序,然后转动门把手,即可打开门锁。如果按压顺序正确,门就会神奇地打开。

A combination consists of 1 or more buttons being pressed simultaneously. A sequence consists of a series of combinations. A sequence must have at least one combination. Once a button has been used in a combination, it may not be used again in the same sequence. In addition, it is not necessary to use all the buttons in a sequence. For example, for B = 8:

一个组合包括同时按下一个或多个按钮。序列由一系列组合组成。序列必须至少有一个组合。一个按钮在组合中使用后,不得按相同顺序再次使用。此外,不必使用所有按钮在一个序列中。例如,对于B=8:

(1-2-3)(4)(7-8)

is a valid sequence with 3 combinations (1-2-3), (4), and (7-8). Note that buttons 5 and 6 are not used in this sequence.

是包含3个组合(1-2-3)、(4)和(7-8)的有效序列。请注意,按钮5和6不在此顺序中使用。

(1-2-3)(2-4)(5-6)

is not a valid sequence, since button 2 appears in 2 combinations (1-2-3) and (2-4).

不是有效序列,因为按钮2以两种组合(1-2-3)和(2-4)出现。
The CEO of Frobozz, J. Pierpont Flathead, wants you to write a program that determines the number of valid sequences possible for given values of B. The program must be able to process a list of lock orders (datasets) from customers and generate a report showing the order number, the value of B, and the number of valid sequences possible. This list will always contain at least one dataset, but no more than 100 datasets.

Frobozz的首席执行官J.Pierpont Flathead希望您编写一个程序,确定给定B值可能的有效序列数。该程序必须能够处理来自客户的锁订单列表(数据集),并生成一份显示订单号、B值和可能的有效序列数的报告。此列表将始终包含至少一个数据集,但不超过100个数据集。

 

输入:

The first line of input contains a single integer N, (1 ≤ N ≤ 100), representing the number of datasets that follow. Each dataset consists of a single line of data containing a single integer B, which is the number of buttons for the lock.

第一行输入包含一个整数N(1)≤ N≤ 100),表示随后的数据集数量。每个数据集由一行数据组成,其中包含一个整数B,即锁的按钮数。

输出:

 For each dataset, display the dataset number, a blank, the value B, a blank, and the number of valid sequences.

对于每个数据集,显示数据集编号、空白、值B、空白和有效序列数。

样例输入:

3
3
4
3

样例输出:

1 3 25
2 4 149
3 3 25
posted @ 2022-02-07 23:06  次林梦叶  阅读(44)  评论(0)    收藏  举报