Help me in solving RATINGINPRAC problem

My issue

in my code editor am getting all my test case positive but in codechef editor its totally opposite

My code

#include <iostream>
using namespace std;

int main() {
    
   
    int t;
    cin >> t;
    int cnt=1;
     
    while(t--){
         int d2;
    // no. of problems solved by the students 
    cin >> d2;
    int i=0;
        int arr[d2];
        for(i =0;i <d2; i++){
            cin >> arr[i];
    }   
    for (i=0;i<d2;i++){
         if(arr[i]<=arr[i-1]){
             if(arr[i]==arr[i-1]){
                 cnt = 1;
             }
             else{
                    cnt=0;
                    break;
         }
         }
    }
        if(cnt == 1){
            cout << "Yes"<<endl;
        }else{
            cout << "No"<<endl;
        }
    }
	return 0;
}

Learning course: Arrays using C++
Problem Link: CodeChef: Practical coding for everyone