1 条题解

  • 1
    @ 2023-4-15 15:43:32
    #include<iostream>
    #include<math.h>
    #include<string.h>
    using namespace std;
    int n,x,y;
    bool a[3001];
    int main(){
    	while(cin>>n){
    		memset(a,false,sizeof(a));
            cin>>x;
    		for(int i=2;i<=n;i++){
                cin>>y;
    			int cha=abs(y-x);
                if(cha<n)a[cha]=true;
                x=y;
    		}
    		int cnt=0;
    		for(int i=1;i<=n-1;i++)if(a[i])cnt++;
    		if(cnt==n-1)cout<<"Jolly\n";
    		else cout<<"Not jolly\n";
    	}
    	return 0;
    }
    
  • 1

信息

ID
1024
时间
1000ms
内存
128MiB
难度
8
标签
递交数
229
已通过
44
上传者