fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;cin>>n;
  6. int A[n];
  7. for(int i=0;i<n;++i)cin>>A[i];
  8. int i=0;
  9. while(i<n-1 && A[i] < A[i+1]) ++i;
  10. if( i != 0 && A[i]==A[i-1]){cout<<"false";return 0;}
  11. while(i<n-1 && A[i] > A[i+1]) ++i;
  12. if(i==n-1)cout<<"true";
  13. else cout<<"false";
  14. return 0;
  15. }
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
false