1. #include<iostream>
  2. #include<set>
  3. #include<stdio.h>
  4. using namespace std;
  5.  
  6. int my_abs(int);
  7. int main()
  8. {
  9. //freopen("acm.acm","r",stdin);
  10. int num;
  11. int i;
  12. int * a;
  13. set<int> coll;
  14. while(cin>>num)
  15. {
  16. a = new int[num];
  17. for(i = ; i < num; ++ i)
  18. {
  19. cin>>a[i];
  20. }
  21. for(i = ; i < num - ; ++ i)
  22. {
  23. coll.insert(my_abs(a[i] - a[i+]));
  24. }
  25. if((coll.size() == num - &&*coll.begin() == && *coll.rbegin() == num - ||num == ))
  26. cout<<"Jolly"<<endl;
  27. else
  28. cout<<"Not jolly"<<endl;
  29. coll.clear();
  30. delete[] a;
  31. }
  32. }
  33. int my_abs(int num)
  34. {
  35. if(num >= )
  36. return num;
  37. else
  38. return num * (-);
  39.  
  40. }

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. 将批量指定的docker镜像打成文件

      #/bin/bash tag= img1=hub.chinacloud.com.cn/onex.dev/one-task-scheduler:$tag img2=hub.chinacloud.co ...

  2. oracle学习笔记一:用户管理(2)创建删除用户

    本文主要介绍如何创建和删除用户,当然里面牵涉很多知识,慢慢道来. 1,创建用户 需求:假设你是oracle管理员,当一个同事入职,你需要分配给一个账号. 创建用户,一般需要有相应权限的用户才可以创建用 ...

  3. 不同数据源之间的数据同步jdbc解决方案

    最近项目中用到的数据要从一个数据源获取存进另一个数据源,简单的jdbc解决方案. package com.sh.ideal.test.syns; import java.sql.Connection; ...

  4. sublime text2一些使用技巧+插件

    一.前言 作为一个前端,有一款好的开发利器是必不可少的,editplus.notepad++都是不错的工具,体积轻巧,启动迅速(dw太浮肿了).最近,又有一款新的编辑器诞生,席卷前端界,惹得无数喜爱, ...

  5. 1.2.1继承Thread类

    实现多线程的方法有2种:方法一是继承Thread,方法二是实现Runnerable接口 使用继承Thread类的方法创建多线程的时候,最大的局限性就是不支持多继承,因为java语言的特点就是单继承,因 ...

  6. css3实现卡牌旋转与物体发光效果

    效果演示 http://demo.qpdiy.com/hxw/CSS3/rotate+light.html 物体旋转: 卡牌同一位置放2张图片,通过设置3D动画旋转实现 animation: card ...

  7. ASP.NET Web API 框架研究 Controller实例的销毁

    我们知道项目中创建的Controller,如ProductController都继承自ApiController抽象类,其又实现了接口IDisposable,所以,框架中自动调用Dispose方法来释 ...

  8. ASP.NET Web API 框架研究 Controller创建 HttpController 类型解析 选择 创建

    上一篇介绍了HttpController的一些细节,接下来说下HttpController 类型解析.选择和创建.生产HttpController实例的生产线如下图: 一.涉及的类及源码分析 涉及的类 ...

  9. RxSwift学习笔记6:Subjects/PublishSubject/BehaviorSubject/ReplaySubject/Variable

    // 从前面的几篇文章可以发现,当我们创建一个 Observable 的时候就要预先将要发出的数据都准备好,等到有人订阅它时再将数据通过 Event 发出去. // 但有时我们希望 Observabl ...

  10. Android-Could not find method implementation() for arguments

    当AndroidStudio加载工程的时候:报以下错误: 详细错误: Could not find method implementation() for arguments [file collec ...