E.Extreme Sort
代码:
1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 #include<cmath> 6 using namespace std; 7 const int maxn=1e5+10; 8 int a[maxn]; 9 int main(){ 10 int n; 11 scanf("%d",&n); 12 for(int i=0;i<n;i++) 13 scanf("%d",&a[i]); 14 for(int i=1;i<n;i++){ 15 if(a[i]<a[i-1]){ 16 cout<<"no"<<endl; 17 return 0; 18 } 19 } 20 cout<<"yes"<<endl; 21 }