Source Code
#include <math.h>
int main(void) {

int n;
int a[100000];
scanf("%d",&n);
for (int i=0; i<n;i++)
{scanf( "%d",&a[i]);

}
int y=0;
for(int i=0;i<n-1;i++)
{ if(a[i]>a[i+1]){
++y;
}}
if(y==0)printf("YES");
 else printf("NO");
return 0;
}
Copy
Anton Can't See (⊙︿⊙)_/¯ Lyn almousa
GNU GCC C11
15 ms
1.1 MB
Accepted