Wrong Answer
Code
#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false)
#define ct cin.tie(nullptr)
#define ll long long
#define nl '\n'
#define newline cout<<'\n'
#define yes cout<<"YES"<<'\n'
#define no cout<<"NO"<<'\n'
using namespace std;
void solve()
{
}
int main()
{
fast;
ct;
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int>arr(n);
for(auto& x: arr)
cin>>x;
bool ms = false;
for(int i=0; i+1<n; i++)
{
if(abs(arr[i]-arr[i+1])==1)
ms=true;
else
{
ms=false;
}
}
if(ms)
yes;
else
no;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1229 Array of Beauty
- Contest
- LUCC Presents Kick & Code Intra LU Programming Contest
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-09-01 07:08:06
- Judged At
- 2025-09-01 07:08:06
- Judged By
- Score
- 30
- Total Time
- 4ms
- Peak Memory
- 580.0 KiB