We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 512aa87 commit a3c5669Copy full SHA for a3c5669
1742B - Increasing.cpp
@@ -0,0 +1,38 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+bool check(int a[], int n)
10
+{
11
+ sort(a,a+n);
12
+ for(int i=0; i<n-1; i++)
13
+ {
14
+ if(a[i]==a[i+1])
15
+ return 0;
16
+ }
17
+ return 1;
18
+}
19
+int main()
20
21
+ int t;
22
+ cin>>t;
23
+ while(t--)
24
25
+ int n;
26
+ cin>>n;
27
+ int a[n];
28
+ for(int i=0; i<n; i++)
29
30
+ cin>>a[i];
31
32
+ if(check(a,n))
33
+ cout<<"YES"<<endl;
34
+ else
35
+ cout<<"NO"<<endl;
36
37
38
0 commit comments