#include<iostream>
#include<set>
#include<stdio.h>
using namespace std; int my_abs(int);
int main()
{
//freopen("acm.acm","r",stdin);
int num;
int i;
int * a;
set<int> coll;
while(cin>>num)
{
a = new int[num];
for(i = ; i < num; ++ i)
{
cin>>a[i];
}
for(i = ; i < num - ; ++ i)
{
coll.insert(my_abs(a[i] - a[i+]));
}
if((coll.size() == num - &&*coll.begin() == && *coll.rbegin() == num - ||num == ))
cout<<"Jolly"<<endl;
else
cout<<"Not jolly"<<endl;
coll.clear();
delete[] a;
}
}
int my_abs(int num)
{
if(num >= )
return num;
else
return num * (-); }

POJ 2575的更多相关文章

  1. POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理

    Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798 ...

  2. POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理

    Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   ...

  3. POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治

    The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286 ...

  4. POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法

    Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Descr ...

  5. POJ 3254. Corn Fields 状态压缩DP (入门级)

    Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Descr ...

  6. POJ 2739. Sum of Consecutive Prime Numbers

    Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20050 ...

  7. POJ 2255. Tree Recovery

    Tree Recovery Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11939   Accepted: 7493 De ...

  8. POJ 2752 Seek the Name, Seek the Fame [kmp]

    Seek the Name, Seek the Fame Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 17898   Ac ...

  9. poj 2352 Stars 数星星 详解

    题目: poj 2352 Stars 数星星 题意:已知n个星星的坐标.每个星星都有一个等级,数值等于坐标系内纵坐标和横坐标皆不大于它的星星的个数.星星的坐标按照纵坐标从小到大的顺序给出,纵坐标相同时 ...

随机推荐

  1. mongodb知识积累

    1: 安装mongodb https://www.cnblogs.com/zhangdaicong/p/7492494.html 2:配置文件 vi /etc/mongodb.conf https:/ ...

  2. 安卓4.2用adb 获取屏幕分辨率等信息

    在终端输入adb shell dumpsys: 终端会打印出一些service list 用adb shell dumpsys+service名即可查询相应的信息. 屏幕分辨率用adb shell d ...

  3. mysql 入门 jdbc

    在java程序中连接mysql,先要到mysql的网站上面去下载驱动,并且安装,默认安装在c盘(我的都是默认安装,目录为C:\Program Files\MySQL\MySQL Connector J ...

  4. C#版ObjectId

    近来在准备弄一个开源的HIS,但一周过去了几乎没有进度.就卡在ID如何生成.HIS的数据库压力大,如何多数据库支持,减轻压力一直想去实现.拿不准纯数字ID段还是GUID一类的文本ID.最终在mongo ...

  5. MVC框架-.net-摘

    MVC模式(三层架构模式)(Model-View-Controller)是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型(Model).视图(View)和控制器(Controller) ...

  6. 最短路 模板 【bellman-ford,dijkstra,floyd-warshall】

    Bellman-ford: /* bellman ford */ #include <iostream> #include <cstdio> #include <cstr ...

  7. SRM479

    250pt: 题意:有一排一共44,777,777个人,每个人需要咖啡或者茶,队伍的头部有一台饮料机,有一个空姐负责给所有人送饮料,她一开始在也头部.空姐拿一个水壶,一开始是空的,可以在饮料机的地方加 ...

  8. shell 命令 mkdir -p

    开发中我们会遇到嵌套创建文件目录的需要,这时需要用到 mkdir -p 比如我要在本地嵌套创建 /Users/dairui/Downloads/zookeeper/dataLogDir目录 直接使用 ...

  9. Java学习---- 数组的引用传递

    1. public class ArrayRefDemo01{ public static void main(String args[]){ int temp[] = {1,3,5} ; // 利用 ...

  10. Network in Network 个人理解

    关键点是1*1的卷积是怎么用的,也就是MLP卷积.看如下的数据就可以理解了 输入为224*224*3的图像,第一层卷积为11*11*3*96(也就是96个11*11*3的卷积核,另外还有步长),卷积完 ...