第一范文网 - 专业文章范例文档资料分享平台

1.6编程基础之一维数组(15)

来源:用户分享 时间:2025/6/2 7:23:55 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

INPUT DETAILS:

The shipment was 14 kilograms of feed, and Farmer John has 4 kilograms left. He had three cows that ate feed for some amount of time in the last 10 days.

OUTPUT DETAILS:

If Farmer John started with 14 kg of feed on day 6, then on days 6 and 7, two kilograms would be eaten each day. On day 8, three kilograms would be eaten. On day 9, two kilograms would be eaten. On day 10, one kilogram would be eaten. Thus, the total eaten would be 2 + 2 + 3 + 2 + 1 = 10, leaving him with 4 kilograms.

来源

USACO 2005 February Silver

13(t1577:Jolly Jumpers)

总时间限制:

1000ms

内存限制:

65536kB

描述

A sequence of n > 0 integers is called a jolly jumper if the absolute values of the difference between successive elements take on all the values 1 through n-1. For instance, 1 4 2 3

is a jolly jumper, because the absolutes differences are 3, 2, and 1 respectively. The definition implies that any sequence of a single integer is a jolly jumper. You are to write a program to determine whether or

not each of a number of sequences is a jolly jumper.

输入

Each line of input contains an integer n < 3000 followed by n integers representing the sequence.

输出

For each line of input, generate a line of output saying \

样例输入

4 1 4 2 3 5 1 4 2 -1 6 样例输出

Jolly Not jolly 来源

Waterloo local 2000.09.30

搜索更多关于: 1.6编程基础之一维数组(15) 的文档
1.6编程基础之一维数组(15).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c1rvqu7ykm081m9t3zgzo_8.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top