Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么总是Output Limit Exceed,请各位高手指点一下,本人不胜感激!!#include <iostream> #include <cmath> using namespace std; int main() { int num,a[3000]; while(1) { cin>>num; if(num<=0&&num>=3000) break; for(int i=0;i<num;i++) { cin>>a[i]; } int b=0; for(i=0;i<(num-1);i++) { if(abs(a[i+1]-a[i])!=(num-i-1)) { b=1; break; } } if(b==0) cout<<"Jolly"<<endl; else cout<<"Not jolly"<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator