Skip to content

Commit ba35c8b

Browse files
committed
1810A - Beautiful Sequence.cpp
1 parent 8643b76 commit ba35c8b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

1810A - Beautiful Sequence.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define pb push_back
5+
#define ll long long
6+
7+
// Code Written By: Vikash Patel
8+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
9+
10+
int main()
11+
{
12+
int t;
13+
cin>>t;
14+
while(t--)
15+
{
16+
int n;
17+
cin>>n;
18+
int a[n];
19+
for(int i=0; i<n; i++)
20+
{
21+
cin>>a[i];
22+
}
23+
bool beautiful = false;
24+
for(int i=0; i<n; i++)
25+
{
26+
if((i+1)>=a[i])
27+
{
28+
beautiful = true;
29+
break;
30+
}
31+
}
32+
if(beautiful)
33+
cout<<"YES"<<endl;
34+
else
35+
cout<<"NO"<<endl;
36+
}
37+
return 0;
38+
}

0 commit comments

Comments
 (0)