Problem 1890 --Problem C: Jolly Jumpers

1890: Problem C: Jolly Jumpers

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $4$ 正确数量 $2$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Problem C: Jolly Jumpers

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 "Jolly" or "Not jolly".

4 1 4 2 3
5 1 4 2 -1 6
Jolly
Not jolly

推荐代码 查看1890 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] AOJ大管家 84405 2017-04-27 15:28:24
内存最少[$948 $KB] AOJ大管家 84405 2017-04-27 15:28:24
第一AC AOJ大管家 84405 2017-04-27 15:28:24
第一挑战 AOJ大管家 84405 2017-04-27 15:28:24

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛