现在的位置: 首页 > 综合 > 正文

uva 10038

2018年10月30日 ⁄ 综合 ⁄ 共 349字 ⁄ 字号 评论关闭
#include <iostream>
#include <string> 
#include <vector>
#include <cmath>
using namespace std ;

int main()
{
    
    int n ;
    while (cin>>n)
    {
    	bool flag = false ;
        vector<int> a(3000) ;
        vector<int> b(3000) ;
        cin  >> a[0] ;
    	for (int i = 1 ; i < n ; ++i)
    	{
    	        cin >> a[i] ;
    	        b[i] = abs(a[i]-a[i-1]) ;
        }
    	
    	for ( int j = 0 ; j < n  ;++j)
    	        if ( b[j] > n-1)  
	            {
			 flag = false ;
			       break ;  
		    }
    	        else flag = true ;
            if(flag ) cout <<"Jolly" << endl ;
	    else cout <<"Not jolly " << endl ;    	    
    	       
    }   
}

【上篇】
【下篇】

抱歉!评论已关闭.