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个星星的坐标.每个星星都有一个等级,数值等于坐标系内纵坐标和横坐标皆不大于它的星星的个数.星星的坐标按照纵坐标从小到大的顺序给出,纵坐标相同时 ...
随机推荐
- 将批量指定的docker镜像打成文件
#/bin/bash tag= img1=hub.chinacloud.com.cn/onex.dev/one-task-scheduler:$tag img2=hub.chinacloud.co ...
- oracle学习笔记一:用户管理(2)创建删除用户
本文主要介绍如何创建和删除用户,当然里面牵涉很多知识,慢慢道来. 1,创建用户 需求:假设你是oracle管理员,当一个同事入职,你需要分配给一个账号. 创建用户,一般需要有相应权限的用户才可以创建用 ...
- 不同数据源之间的数据同步jdbc解决方案
最近项目中用到的数据要从一个数据源获取存进另一个数据源,简单的jdbc解决方案. package com.sh.ideal.test.syns; import java.sql.Connection; ...
- sublime text2一些使用技巧+插件
一.前言 作为一个前端,有一款好的开发利器是必不可少的,editplus.notepad++都是不错的工具,体积轻巧,启动迅速(dw太浮肿了).最近,又有一款新的编辑器诞生,席卷前端界,惹得无数喜爱, ...
- 1.2.1继承Thread类
实现多线程的方法有2种:方法一是继承Thread,方法二是实现Runnerable接口 使用继承Thread类的方法创建多线程的时候,最大的局限性就是不支持多继承,因为java语言的特点就是单继承,因 ...
- css3实现卡牌旋转与物体发光效果
效果演示 http://demo.qpdiy.com/hxw/CSS3/rotate+light.html 物体旋转: 卡牌同一位置放2张图片,通过设置3D动画旋转实现 animation: card ...
- ASP.NET Web API 框架研究 Controller实例的销毁
我们知道项目中创建的Controller,如ProductController都继承自ApiController抽象类,其又实现了接口IDisposable,所以,框架中自动调用Dispose方法来释 ...
- ASP.NET Web API 框架研究 Controller创建 HttpController 类型解析 选择 创建
上一篇介绍了HttpController的一些细节,接下来说下HttpController 类型解析.选择和创建.生产HttpController实例的生产线如下图: 一.涉及的类及源码分析 涉及的类 ...
- RxSwift学习笔记6:Subjects/PublishSubject/BehaviorSubject/ReplaySubject/Variable
// 从前面的几篇文章可以发现,当我们创建一个 Observable 的时候就要预先将要发出的数据都准备好,等到有人订阅它时再将数据通过 Event 发出去. // 但有时我们希望 Observabl ...
- Android-Could not find method implementation() for arguments
当AndroidStudio加载工程的时候:报以下错误: 详细错误: Could not find method implementation() for arguments [file collec ...