1 #include <cstdio> 2 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 3 4 int main() 5 { 6 int flag=1;//0 no 1 yes 7 int n;int m; 8 int a[100001]={0}; 9 scanf("%d",&n); 10 while(n--){ 11 scanf("%d",&m); 12 for(int i=0;i<m;i++){ 13 scanf("%d",&a[i]); 14 } 15 flag = 1; 16 for(int i=0;i<m-1;i++){ 17 if(a[i]>a[i+1]){ 18 flag=0; 19 break; 20 } 21 } 22 if(flag==1) 23 printf("Yes "); 24 else printf("No "); 25 26 } 27 return 0; 28 }