From c52b36c6a37fdb1d1de146d3939cb42e2c691f44 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Sat, 5 Nov 2022 01:28:02 +0200 Subject: Solved 6 problem in filtrationContest and restructured the repo --- .../DiffucltyRatingOrder/DiffucltyRatingOrder.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp (limited to 'codeforces/DiffucltyRatingOrder') diff --git a/codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp b/codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp new file mode 100644 index 0000000..1ed740d --- /dev/null +++ b/codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +bool isIncreasing(vector v) { + for(int i = 0; i < v.size() - 1; i++) { + if(v[i+1] < v[i]) { + return false; + } + } + return true; +} + + +int main() { + int tt; + cin >> tt; + while(tt--) { + int n; + cin >> n; + vector v(n); + for(int &x : v) cin >> x; + cout << (isIncreasing(v) ? "YES" : "NO") << '\n'; + } +} -- cgit v1.2.3