作业帮 > 英语 > 作业

英语翻译World Cup NoiseTime Limit:1000MS Memory Limit:30000KTota

来源:学生作业帮 编辑:拍题作业网作业帮 分类:英语作业 时间:2024/04/28 13:04:47
英语翻译
World Cup Noise
Time Limit:1000MS Memory Limit:30000K
Total Submissions:5638 Accepted:2767
Description
Background
"KO-RE-A,KO-RE-A" shout 54.000 happy football fans after their team has reached the semifinals of the FIFA World Cup in their home country.But although their excitement is real,the Korean people are still very organized by nature.For example,they have organized huge trumpets (that sound like blowing a ship's horn) to support their team playing on the field.The fans want to keep the level of noise constant throughout the match.
The trumpets are operated by compressed gas.However,if you blow the trumpet for 2 seconds without stopping it will break.So when the trumpet makes noise,everything is okay,but in a pause of the trumpet,the fans must chant "KO-RE-A"!
Before the match,a group of fans gathers and decides on a chanting pattern.The pattern is a sequence of 0's and 1's which is interpreted in the following way:If the pattern shows a 1,the trumpet is blown.If it shows a 0,the fans chant "KO-RE-A".To ensure that the trumpet will not break,the pattern is not allowed to have two consecutive 1's in it.
Problem
Given a positive integer n,determine the number of different chanting patterns of this length,i.e.,determine the number of n-bit sequences that contain no adjacent 1's.For example,for n = 3 the answer is 5 (sequences 000,001,010,100,101 are acceptable while 011,110,111 are not).
Input
The first line contains the number of scenarios.
For each scenario,you are given a single positive integer less than 45 on a line by itself.
Output
The output for every scenario begins with a line containing "Scenario #i:",where i is the number of the scenario starting at 1.Then print a single line containing the number of n-bit sequences which have no adjacent 1's.Terminate the output for the scenario with a blank line.
Sample Input
2
3
1
Sample Output
Scenario #1:
5
Scenario #2:
2
世界杯噪音
时间限制:1000MS内存限制:30000K
共计提交:5638接受:2767
说明
背景
“Ko Re A,Ko Re a”[Korea的中文意思就是韩国]喊54.000幸福的球迷后,他们小组已经进入半决赛的世界杯足球赛在本国.但是,尽管他们的兴奋是真实的,韩国人仍然非常有组织的性质.例如,他们举办了巨大的喇叭(这听起来像吹船舶的号角) ,以支持他们的球队发挥的领域.球迷们想保留的噪音水平不断在整个比赛.
该喇叭是由压缩气体.然而,如果您的打击小号为2秒停车,将打破.因此,当小号使噪声,一切都不错,但在暂停的小号,球迷必须吟咏“敲除,再一个” !
在比赛开始前,一群球迷聚集,并决定在高喊格局.该模式是一个序列的0和1的这是解释的方式如下:如果该模式表明,1日,是吹小号.如果显示为0 ,球迷高喊“高,再一个” .为了确保小号不会打破的模式是不允许有两个连续的1号中.
问题
鉴于一个正整数氮,确定若干不同的诵经这一模式的长度,即确定人数的n位序列,不包含邻近的1号.例如,对于3例,答案是5 (序列000 ,001 ,010 ,100 ,101是可以接受的,而011 ,110 ,111不是) .
输入
第一行包含了一些设想.
对于每个情况下,您有一个单一的正整数不少于45上线的本身.
输出
输出为每个场景一开始就行“ #场景一:”我是许多情况下从1开始.然后打印一个单一的行的数目的n位序列都没有邻近的1号.终止输出的情况下与一个空白行.
样品输入


1
范例输出
情景# 1 :

情景# 2 :