Skip to content

Commit

Permalink
Merge pull request #33 from Saini2709/main
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
coolbroprograms committed Oct 18, 2022
2 parents 1242170 + 05bda5a commit b78fccb
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions codeforces/A_Cubes_Sorting.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <iostream>

using namespace std;

int main()
{
int t, n, flag;
cin >> t;
for (int k = 0; k < t; k++)
{
cin >> n;
int x[n];
for (int i = 0; i < n; i++)
{
cin >> x[i];
}
flag = 0;
for (int i = 0; i < n - 1; i++)
{
if (x[i] <= x[i + 1])
flag = 1;
}
if (flag)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}

0 comments on commit b78fccb

Please sign in to comment.