Help me in solving RATINGINPRAC problem

My issue

I am unable to fetch what is wrong in my code

My code

#include <iostream>
using namespace std;

int main() {
 int T,N;
    cin>>T;
    while(T--){
        cin>>N;
        int A[N];
        for(int i=0;i<N;i++){
            cin>>A[i];
        }
         for(int i=0;i<N;i++){
             if(A[i]>=A[i-1]){cout<<"yes\n";
         }
         else{
             cout<<"No\n";
         }
    }
	return 0;
}}

Learning course: Arrays using C++
Problem Link: Difficulty Rating Order Practice Problem in - CodeChef

Your Code is printing yes and no for every check it does in an array

What you need to do is that:
check whole array that it is in non decreasing order or not then print yes or no

for that:

include
using namespace std;

int main() {
int T,N;
cin>>T;
while(T–){
cin>>N;
int A[N];
for(int i=0;i<N;i++){
cin>>A[i];
}
bool flag=1;
for(int i=1;i<N;i++){
if(A[i]<A[i-1])
{flag=0;break;}
}
if(flag==1)
cout<<“YES”;
else
cout<<“NO”;
cout<<endl;
}
return 0;
}

thanks a lot…got the mistake