-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1742B.cpp
More file actions
37 lines (31 loc) · 670 Bytes
/
Copy path1742B.cpp
File metadata and controls
37 lines (31 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int t, n, arr[100];
bool flag = false;
cin >> t;
for(int i=0; i<t; i++){
cin >> n;
for(int j=0; j<n; j++){
cin >> arr[j];
}
if(n == 1){
cout << "YES" << endl;
continue;
}
sort(arr, arr + n);
for(int k=0; k<n-1; k++){
if(arr[k]-arr[k+1]==0){
cout << "NO" << endl;
flag = true;
break;
}
}
if(flag == false) {
cout << "YES" << endl;
}
flag = false;
}
return 0;
}