Skip to content

Commit a3c5669

Browse files
committed
Added 1742B - Increasing.cpp
1 parent 512aa87 commit a3c5669

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

1742B - Increasing.cpp

+38
Original file line numberDiff line numberDiff line change
@@ -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+
return 0;
38+
}

0 commit comments

Comments
 (0)