Source Code
#include<string>
#include <iostream>
using namespace std;


int main() {

	int a[100000],t,n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	bool flag = false;
		for (int i = 1; i < n; i++) {
			if (a[i] < a[i - 1])
			{
				cout << "NO";
				flag = true;
				break;
			}
		}
		if(flag==false)
		cout << "YES";

}
Copy
Anton Can't See (⊙︿⊙)_/¯ hatamleh
GNU G++17
28 ms
1.2 MB
Accepted