#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. boost--ref

    1.ref简介 reference_wrapper包含在ref库中,它是引用包装器类型,即其内部包装了引用. 成员函数get().get_pointer()分别可以获得被包装的引用和其指针.使用需要包 ...

  2. excel怎样添加的选项卡中含有下拉列表

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon s ...

  3. typecho 调用评论最多热门文章

    在当前主题的functions.php文件中添加以下函数代码: function getHotComments($limit = 10){ $db = Typecho_Db::get(); $resu ...

  4. js点击空白处触发事件

    我们经常会出现点击空白处关闭弹出框或触发事件 <div class="aa" style="width: 200px;height: 200px;backgroun ...

  5. JVM、JRE,JDK

    JVM解释class     Java虚拟机,解释编译后的class文件给系统..java代码编译成 .class机器指令,就能在JVM运行了,直接到硬件执行,实现了跨平台,只要操作系统安装了JVM, ...

  6. Forward团队-爬虫豆瓣top250项目-代码设计规范

    组长地址:http://www.cnblogs.com/mazhuangmz/p/7603641.html 成员:马壮,李志宇,刘子轩,年光宇,邢云淇,张良 1.缩进采用一个Tab键 2.大括号:如: ...

  7. 你可能不知道的Shell

    Shell也叫做命令行界面,它是*nix操作系统下用户和计算机的交互界面.Shell这个词是指操作系统中提供访问内核服务的程序. 这篇文章向大家介绍Shell一些非广为人知.但却实用有趣的知识,权当品 ...

  8. 我看Windows 8.1

    在大家惊叹于Windows 8的大胆创新之时,Windows 8.1却已然来到.在公布了Preview之后,笔者便迫不及待地进行了安装,并在这里简单的说说最直观的感受. 提到Windows 8,不得不 ...

  9. STL容器(C11)--unordered_map用法

    http://www.cplusplus.com/reference/unordered_map/unordered_map/

  10. POJ3177tarjan缩点_构建双连通图

    POJ3177tarjan缩点_构建双连通图 根据题意利用tarjan算法进行缩点处理后变成连通无环图,也可以说是一颗树,而且边是双向的所以,如果把这个图变成双连通,那就要对所有度为1的点进行加边处理 ...