UVa 10038 - Jolly Jumpers
来源:互联网 发布:淘宝神笔入口 编辑:程序博客网 时间:2024/05/22 17:40
UVa 10038 - Jolly Jumpers
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=979
UVA上边的一道水题,在这复制粘添下代码,纯粹是自己的解决方案,仅供参考!
#include <iostream>#include<algorithm>#include<cmath>#include<string>#include<cstring>using namespace std;const int maxx=3010;int a[maxx],b[maxx];int main(){ int n,i; while(cin>>n) { memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); if(n==0) break; else { for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n-1;i++) b[i]=fabs(a[i+1]-a[i]); sort(b,b+n-1); for(i=0;i<n-1;i++) if(b[i]!=i+1) break; if(i==n-1) cout<<"Jolly"<<endl; else cout<<"Not jolly"<<endl; } }}简单易懂,欢迎提问留言!!!
- UVa 10038 Jolly Jumpers
- UVa 10038 - Jolly Jumpers
- uva 10038 Jolly Jumpers
- UVa 10038 - Jolly Jumpers
- UVa 10038 - Jolly Jumpers
- UVa 10038 Jolly Jumpers
- UVa 10038 Jolly Jumpers
- UVa OJ 10038-Jolly Jumpers
- UVa OJ 10038 - Jolly Jumpers
- UVa Problem Solution: 10038 - Jolly Jumpers
- 10038 - Jolly Jumpers
- 10038 - Jolly Jumpers
- UVa Problem 10038 Jolly Jumpers (快乐的跳跃者)
- UVa 10038 / POJ 2575 / ZOJ 1879 Jolly Jumpers (water ver.)
- Jolly Jumpers
- jolly jumpers
- UvaOJ 10038 - Jolly Jumpers 题解以及代码
- fjnu 1532 Jolly Jumpers
- zen cart网站设置浏览器选项卡左上角图标
- hiredis示例代码example-ac.c的编译
- 让好习惯坚持下去
- uva 10910 - Marks Distribution(dp)
- Java笔记---sql错误:Unknown column 'Java?…?é—¨??°???é??' in 'where clause'
- UVa 10038 - Jolly Jumpers
- 所引用的程序集没有强命名
- hdu3466
- 【Maven实用技巧】03. Maven 编译打包时如何忽略测试用例
- hdu 4059 The Boss on Mars(容斥原理)
- OCP-1Z0-053-V12.02-12题
- onInterceptTouchEvent()的机制
- 用一组键盘和鼠标控制局域网内的多台电脑!
- hdu 3887 (树状数组)