90 WAon#10
查看原帖
90 WAon#10
1612450
LuMingYi4sb楼主2025/1/18 13:08
#include <iostream>
#include <cmath>
#include <vector>
long long n,input;
std::vector<long long> a;
long long s[114514];
bool flag = false;
signed int main()
{
    std::cin>>n;
    for(long long i = 0;i < n;i++)
    {
        std::cin>>input;
        a.push_back(input);
    }
    for(long long i = 0;i < a.size()-1;i++)
    {
    	s[abs(a[i]-a[i+1])] = 1;
	}
	for(long long i = 1;i < n;i++)
	{
		s[i] == 0?flag = true:flag = false;
	}
    flag?std::cout<<"Not jolly":std::cout<<"Jolly";
    return 0;
}

求助

2025/1/18 13:08
加载中...