///////////////////////////////////////////////////////
#include <iostream>
#include <algorithm>
using namespace std;
bool st[3000];

 

int main()
{
    int n;
    int a,b;
    while(cin>>n)
    {
        cin>>a;
        int i;
        int temp;
        for(i=0;i<3000;i++)
            st[i]=0;
        for(i=1;i<n;i++)
        {
            cin>>b;
            temp=abs(a-b);
            if(temp<1 || temp>n-1)
                continue;
            st[temp]=1;
            a=b;
        }
        int flag=1;
        for(i=1;i<=n-1;i++)
            if(!st[i])
                flag=0;
        if(flag)
            cout<<"Jolly"<<endl;
        else
            cout<<"Not jolly"<<endl;
    }
    return 0;
}

 

相关文章:

  • 2021-09-08
  • 2022-02-14
  • 2022-02-21
  • 2021-11-05
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-02-08
  • 2021-06-17
  • 2021-07-26
相关资源
相似解决方案