云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 1.6编程基础之一维数组(15)

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

  • 62 次阅读
  • 3 次下载
  • 2025/6/15 5:18:46

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) 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

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

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com