POJ 2575
#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的更多相关文章
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- 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 ...
- poj 2352 Stars 数星星 详解
题目: poj 2352 Stars 数星星 题意:已知n个星星的坐标.每个星星都有一个等级,数值等于坐标系内纵坐标和横坐标皆不大于它的星星的个数.星星的坐标按照纵坐标从小到大的顺序给出,纵坐标相同时 ...
随机推荐
- ibatis注意要点
一.ibatis的关键字like查询 select * from t_student where s_name '%张%'; 这种like语句在ibatis中怎么写,他们现在的项目是用ibatis作为 ...
- understand试用笔记一阅读VS2010项目
一.查看vs2010项目 打开understand,File—New—Project...—Next—Next [向导第三步,选“Import Visual Sudio project files”] ...
- hadoop hive组件介绍及常用cli命令
Hive架构图 Hive产生原因 1 关系型数据库以产生多年sql成熟 2 简化开发降低成本 3 java成员可编写udf函数 Hive是什么 Hive是基于hadoop的一个数据库工具,使用Hql作 ...
- python处理中文
python 清洗中文文件 需要用到的两个链接: 1,unicode编码转换器 http://www.bangnishouji.com/tools/chtounicode.html 2,Python匹 ...
- DDR II中的延时参数
CL (CAS latency) CL是从读命令发出到有效数据到DDR端口的延时,以时钟为单位.下图分别表示CL = 3和CL = 4的两种情况, 如果读命令在第n个时钟周期发出,CL = m,则读 ...
- asp.net文件上传下载
泽优大文件上传产品测试 泽优大文件上传控件up6,基于php开发环境测试. 开发环境:HBuilder 服务器:wamp64 数据库:mysql 可视化数据库编辑工具:Navicat Premium ...
- crontab条目包含%号问题
crontab条目中包含%号,最常见的取时间,如:date +%d, 对%需要使用\进行转义,否则不能按预期执行,正确做法为: * * * * * echo "`date +\%d`&quo ...
- C# String字符串
C#(静态String类) C#中提供了比较全面的字符串处理方法,很多函数都进行了封装为我们的编程工作提供了很大的便利.System.String是最常用的字符串操作类,可以帮助开发者完成绝大部分的字 ...
- 上传图片JS插件Plupload
Plupload有以下功能和特点: 1.拥有多种上传方式:HTML5.flash.silverlight以及传统的<input type=”file” />.Plupload会自动侦测当前 ...
- quartz之hello(java)
quartz 任务调度框架 简单的说:就是在特定的时间,干指定的事件,然后具体到某个对象去做 quartz初之体验: 1.pom.xml文件(导入jar包) <dependencies&g ...