BUPT|OJ 126. 中序遍历序列
作者:互联网
#include<iostream>
#include<cstring>
#include<math.h>
#include<limits.h>
using namespace std;
/*Input:
2
4
1 2 3 4
4
1 3 2 4
*/
int main()
{
int T,flag,temp;
int a[405],N;
cin>>T;
while(T--){
cin>>N;
flag=1;
temp=INT_MIN;
for(int i=1;i<=N;i++){
cin>>a[i];
if(temp>a[i]) flag=0;
temp=a[i];
}
if(flag) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
标签:OJ,temp,int,中序,BUPT,cin,flag,include 来源: https://blog.csdn.net/wlrrrrrrrrr/article/details/113836639